-
-
Notifications
You must be signed in to change notification settings - Fork 773
Localized child pages don't get deleted correctly if parent pages have localization added after they were created #5383
Description
Description of bug
Requires the localization module
Localized child pages don't get deleted correctly if parent pages have localization added after they were created.
Ordinarily whenever a new localized child page is added, it is linked to the corresponding localized version of its parent page:
In TabController.CeateLocalizedCopyInternal:
// Get the original Tabs Parent
// check the original whether have parent.
if (!Null.IsNull(originalTab.ParentId))
{
TabInfo originalParent = this.GetTab(originalTab.ParentId, originalTab.PortalID, false);
// Get the localized parent
TabInfo localizedParent = this.GetTabByCulture(originalParent.TabID, originalParent.PortalID, locale);
localizedCopy.ParentId = localizedParent.TabID;
}
But if you create a parent page, make it non-localized, add localized children, and then localize the parent the child pages aren't updated to have their corresponding localized parent.
We have found one particular thing that this breaks, but there are probably more:
If you then delete the localized child page, it will mark both child pages as deleted in the database, but only the original localization of the child page will show up in the recycle bin (note that you have to switch locales with the locale selector to see correctly deleted localized pages in the recycle bin).
Steps to reproduce
- Update site language settings:
- Go to Settings -> Site Settings -> Languages tab
- If only English (United States) language is present in the Languages list
- Click Add New Language
- Select English (CAN)
- Click Save button
- If the “Allow Content Localization” option is not on:
- Turn it on
- Click the newly shown Enable Localized Content button
- In the new panel, turn on the “Make All Pages Translatable” switch
- Click Enable Localized Content button
- Wait until all pages have been processed
- If the “Allow Content Localization” option is not on:
- Add a parent page
- Go to Content -> Pages
- Click Add Page button
- Give it the name and title: “Parent page”
- Click Add Page button at the bottom
- Click Publish at the bottom right
- Go back to Content -> Pages, and select the Parent Page
- Click on the new Localization tab
- Click the “Make Page Neutral” button at the bottom left, and Click Yes to confirm deletion of localized pages if they exist
- Add a child page
- Go to Content -> Pages
- Select Parent Page in the list on the left
- Under … menu of the parent page, click Add Page option
- Give it “Child Page” name
- Click “Add Page” at the bottom, and then “Publish” button on the main page
- Localize the child page
- Go to Content -> Pages and select the child page in the list on the left
- Click the new Localization tab
- Click “Add Missing Languages” button
- Add a suffix to the pages titles / names (us / ca), just to easily distinguish them
- Click Update Localization button, and confirm by clicking Continue
- Localize the parent page
- Go to Content -> Pages and select the parent page
- In the Localization tab, click Make Page Translatable button
- Add us/ca suffixes to US and CAN versions titles / names
- Click Update Localization button, and Continue
- Delete the child page
- Go to Content -> Pages and select the child page
- Click Delete button at the bottom and confirm with Delete button in the popup
- Go to Content -> Recycle Bin
- The US Child page should be present in the bin
- Change language to English (Canada) at the top of the page
- Go to Content -> Recycle Bin. The bin is empty
- Switch back to English (US) in the top
- Go to Content -> Recycle Bin, and empty the bin.
- Now both the US and Canada language Recycle Bins are empty but if you check the Tabs table in the database, the US version of the page is deleted, but a zombie version of the Canada page is still there.
Current behavior
When a nonlocalized parent with localized children has localization added, the localized children are not updated to point to their localized parents. This means that deleted localized children without the default language do not show up in the recycle bin.
Expected behavior
When a nonlocalized parent with localized children has localization added, the localized children should be updated to point to their localized parents.
When the child page is then deleted, all localized children should show up in their corresponding localized recycle bin.
Screenshots
Localized child page remains attached to default localization parent page in database:

Should actually be attached to the localized version of its parent page:

US recycle bin
Switching with language selector:

CA recycle bin - empty:
Error information
Additional context
Affected version
Reproducible on any remotely modern version.
- 10.00.00 alpha build
- 09.11.00 release candidate
- 09.10.02 release candidate
- 09.10.01 latest supported release
Affected browser
Any - is a server side issue

