Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to remove a Related Page from the live stage once it has been added to a page #332

Open
adunn49 opened this issue Jul 7, 2023 · 6 comments

Comments

@adunn49
Copy link
Contributor

adunn49 commented Jul 7, 2023

Summary of set up

I have a page type that extends BasePage on which you can add Related Pages.
The template for my page type loops through $RelatedPagesThrough and outputs them to the view.

Issue

It seems that once a related page has been added and published there is no way to remove it from the live page (other than unpublish or delete the related page).

Steps to reproduce issue

  • First add ‘RelatedPage’ and publish it.
  • Create ‘Main Page’ and on the Related pages tab, link existing ‘Related Page’.
  • Publish Main Page

Observations at this point are that the related page appears on the main page.

Also, looking at the database entries the BasePage_RelatedPages_Live table (many many through table) now has the expected entry linking the two pages, as does BasePage_RelatedPages.

At this point we now try to remove the related page:

  • Edit Main page
  • Go to the Related pages tab and ‘Unlink’ the related Page.
  • Publish Main page again

Inspecting the tables again the entry has been removed from BasePage_RelatedPages but it still exists in BasePage_RelatedPages_Live.

Also, in the CMS the draft view no longer shows the related page but the published one still shows it.

@GuySartorelli
Copy link
Member

If you publish the page after clicking unlink, does the link get removed from the _Live table?
Also, what version of this module are you reporting this for?

@GuySartorelli
Copy link
Member

I'm labelling this as a bug for now, but without additional information it won't be prioritised,

@callan-stretton
Copy link

callan-stretton commented Jul 28, 2023

@GuySartorelli I am experiencing this issue too. I can confirm that Publishing the related page does not have any effect. (Version 2.11.0)

@adunn49
Copy link
Contributor Author

adunn49 commented Aug 15, 2023

@GuySartorelli Sorry, just looping back to this. I can also confirm that publishing the page after unlinking does not remove the relevant entry from the _Live table. Using version 2.10.1 of the module.

@michalkleiner
Copy link
Contributor

BasePage just needs adding

private static $cascade_deletes = [
    'RelatedPagesThrough',
];

@michalkleiner
Copy link
Contributor

Just came across the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants