Details
-
Bug
-
Resolution: Fixed
-
High
-
4.4.1, 3.3.31
-
Ibexa Experience
-
Yes
Description
It seems page builder preview uses incorrect siteaccess in a special-case scenario. It is related to all content types with "always available" flag turned off and multi-language sites.
Steps to reproduce
- Install Ibexa DXP v4
- Add new language in Ibexa back-office.
- Configure siteaccesses for multi-language setup
ibexa: siteaccess: list: - site - pl groups: site_group: [site, pl] default_siteaccess: site match: Map\URI: pl: pl URIElement: 1 system: site: languages: [eng-GB, pol-PL] pl: languages: [pol-PL, eng-GB] content: tree_root: location_id: 2
- Uncheck "Always available" flag for "Landing page" content type.
- Create new landing page in eng-GB.
- Create new translation of the same landing page in pol-PL.
Result
All of the template translations as well as fragment subrequests are in eng-GB and preview templates shows current siteaccess "site" even though we're currently editing content in pol-PL and "pl" siteaccess is displayed in the page builder's preview top bar.
Expected
Preview's template translations should be in pol-PL and the same siteaccess (pl) from page builder's preview top bar should be passed to the preview template.
Note
This issue still occurs if we decide to edit again same landing page in pol-PL language.
It seems the incorrect siteaccess is passed to the preview template - should be "pl", but "site" received. Quick debugging shows an issue here:
# Ibexa\Bundle\PageBuilder\Controller\PageController::previewAction()
$resolvedSiteAccess = $isAlwaysAvailable
? $fallbackSiteAccessName
: $this->siteaccessService->resolveSiteAccessForContent($content, $fallbackSiteAccessName);
I don't know why we're trying to resolve siteaccess for non-always-available content instead of just forcing $fallbackSiteAccessName. The method shown above is returning first matched siteaccess (in our case "site" - eng-GB). If we want to validate $fallbackSiteAccessName, we should get the whole list of valid siteaccesses for given content and compare it agains fallback.
Designs
Attachments
Issue Links
- relates to
-
IBX-5923 Invalid siteaccess passed to the page builder preview during translation
- Closed