Details
-
Bug
-
Resolution: Fixed
-
Critical
-
2.2.1
-
None
-
[2.3] Sprint 3
Description
Steps to reproduce:
- Configure at least two different languages on eZ Platform EE. For instance eng-GB and fre-FR.
- Create a Landing Page in eng-GB. Add some blocks and publish it.
- Add fre-FR translation. Add some blocks and publish it.
- Check both translations, each of them should be fine.
- Remove fre-FR translation.
- Check LandingPage.
Result:
All blocks from all translations will be removed after removing one translation.
Expected result:
Landing Page translation should be removed, but all other translations should stay untouched.
Note from the customer:
function loadPagesMappedToContent does not care about the $fieldIds argument that it received then it does not know what to do and remove all.
This argument contains the field IDs of $contentId to be removed, which are all the attribute id related to the French version.
That is it we just need to adapt `loadPagesMappedToContent` to use those ids.
public function deleteFieldData(VersionInfo $versionInfo, array $fieldIds, array $context) { // somehow get the translation information from `$fieldIds` then pass that to loadPagesMappedToContent // and filter the return of loadPagesMappedToContent to return ONLY the page related to the CORRECT translation / $fieldIds $pages = $this->gateway->loadPagesMappedToContent($versionInfo->contentInfo->id, $versionInfo->versionNo); foreach ($pages as $page) { $this->removePage((int) $page['id']); } }