Bug #98176
openPreview of translated siteroot page in EditDocumentController fails to find Site
0%
Description
For the preview URL the rootline of the preview page is traversed to find a Site (which will provide the domain). If the page is a translation the rootline will start with the record of the translation and the SiteFinder fails to find a Site for this page uid.
If a preview of a subpage is made then the rootline will have data for pages in the default language for pages above the preview page. The SiteFinder will then be able to find a Site.
[_] - root folder (to include global stuff) +- Domain1 | +- subpage1 +- Domain2 +- subpage2
If you edit a translation of page "Domain1" and use the View button in the ButtonBar the previewPageId will be that of the translation of page "Domain1". The rootline will contain:
translation "Domain1" --> default language "root folder"
The SiteFinder can't find a Site based on the page uid of the translation of "Domain1".
If you edit a translation of a subpage (e.g. "subpage1") and use the same View button, the rootline will contain:
translation "subpage1" --> default language "Domain1" --> default language "root folder"
Now the SiteFinder will find the Site using the uid of the "Domain1" page in the default language.
Solution¶
The View button is used for all kinds of records. For records other than 'pages' records there will be no problem because the previewPageId will always point to page in the default language. For 'pages' records it needs to be checked if the record is a translation and then the uid of the translation origin pointer needs to be used to generate the rootline.
The issue was found in v10 but looking at the code it's still present in the current code base. A patch for v10 was created which needs to be heavily adjusted for the changes in v11+ in the handling of preview URLs.
No data to display