Affects Version/s: 6.1.X EE, 6.2.X EE
Component/s: Site Templates
LPS-26153 was resolved, it was possible to delete a page template that was referenced by a page. This generally caused the page referencing the deleted template to become unusable, so LPS-43376 added a verify process to delete all orphaned pages. However, under certain conditions, the orphaned page may still be usable, so we don't want to delete it. Specifically, when a page is attached to a deleted page template, but is not set to propagate changes from the page template, it can be edited just like any normal page. This ticket seeks to modify the verify process such that we don't delete orphaned pages for which this is true, but instead we simply delete the reference to the deleted page template so that they are no longer orphaned.
Steps to reproduce:
- Set up a database in a clean bundle of Liferay 6.1.10.
- Add a page using the Blog Page Template.
- Go to the Details Page for the page you just created and uncheck the box "Automatically apply changes done to the page template Blog." Save your changes.
- Delete the Blog Page Template.
- Go to the Page that you created on page 2. Try to edit it and notice that you can edit it and use it just like any other page.
- Shut down the portal.
- Upgrade to the latest version of ee-6.2.x.
Expected result: The page you created in step 2 would still exist because it was a page that might still be actively used. Its reference to the deleted page template would have been removed during the upgrade process.
Actual result: The page was deleted during the upgrade process because it was considered to be an orphaned page.
Clean Bundle of 6.1.10 for steps 1-6: 670acbcd75f08f104aa0272fa4897fd15c9303c7
ee-6.2.x for step 7: 9ef0db2282f805c9d7712f4b7aabe58476591455
Note: The VerifyLayout process for deleting orphaned layouts is also in master, but I didn't test it the same way since I've been having trouble with the upgrade process in master recently. Instead, I manually edited Layouts in the database to be linked to non-existent page templates, and then ran the VerifyLayout process. The git commit in which I did this was a9d93439f07137f3304f565cd160e7374ab12cbb