[BUGFIX] No MM relations when localizing categories
"True" MM relations (those tables that have a "uid_local" and "uid_foreign" db column and NO TCA) have a "local" and a "foreign" side. For instance with categories, the category table is the "local" side, and the referencing table "pages", "tt_content", or whatever table, is the foreign side. Without the patch, MM table rows when localizing the local side of an MM relation is buggy, scenario: A default language tt_content record references a default language category. This gives one row in the mm table. If now the category is localized, a second entry from the localized category to the default language content element is added. This is wrong. The patch fixes this in the DataHandler by setting a dedicated override for this "local side localization" scenario, so the RelationHandler omits MM processing in this case. A functional test is added for non-workspace that exists for workspace already to verify a new relation can still be added when creating the local side. Note this is only half of the picture - MM relation should still be set and updated when a localized foreign side exists for the just localized local side. This does not happen currently and leads to broken MM rows even with the patch. This scenario however needs a bigger refactoring and further increased coverage and will be handled with further patches. Still, this patch is relatively straight forward, increases test coverage for future patches and already solves various long standing forge issues. Change-Id: Ieee8b5a4c101065c03bc7e90c8a4aa36b1bdf6a7 Resolves: #89659 Resolves: #89620 Resolves: #91842 Resolves: #77902 Related: #70460 Related: #62727 Releases: master Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/71094 Tested-by:core-ci <typo3@b13.com> Tested-by:
Jochen <rothjochen@gmail.com> Tested-by:
Oliver Bartsch <bo@cedev.de> Tested-by:
Benni Mack <benni@typo3.org> Reviewed-by:
Jochen <rothjochen@gmail.com> Reviewed-by:
Oliver Bartsch <bo@cedev.de> Reviewed-by:
Benni Mack <benni@typo3.org>
Showing
- typo3/sysext/core/Classes/DataHandling/DataHandler.php 6 additions, 0 deletionstypo3/sysext/core/Classes/DataHandling/DataHandler.php
- typo3/sysext/core/Tests/Functional/DataHandling/ManyToMany/AbstractActionTestCase.php 21 additions, 0 deletions...tional/DataHandling/ManyToMany/AbstractActionTestCase.php
- typo3/sysext/core/Tests/Functional/DataHandling/ManyToMany/Modify/ActionTest.php 15 additions, 6 deletions.../Functional/DataHandling/ManyToMany/Modify/ActionTest.php
- typo3/sysext/core/Tests/Functional/DataHandling/ManyToMany/Modify/DataSet/copyCategoryToLanguageOfRelation.csv 1 addition, 3 deletions...oMany/Modify/DataSet/copyCategoryToLanguageOfRelation.csv
- typo3/sysext/core/Tests/Functional/DataHandling/ManyToMany/Modify/DataSet/createCategoryAndAddRelation.csv 37 additions, 0 deletions...anyToMany/Modify/DataSet/createCategoryAndAddRelation.csv
- typo3/sysext/core/Tests/Functional/DataHandling/ManyToMany/Modify/DataSet/localizeCategoryOfRelation.csv 1 addition, 3 deletions.../ManyToMany/Modify/DataSet/localizeCategoryOfRelation.csv
- typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/AbstractActionTestCase.php 0 additions, 10 deletions...tional/DataHandling/ManyToMany/AbstractActionTestCase.php
- typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Modify/DataSet/localizeCategoryOfRelation.csv 1 addition, 3 deletions.../ManyToMany/Modify/DataSet/localizeCategoryOfRelation.csv
- typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Publish/DataSet/localizeCategoryOfRelation.csv 1 addition, 3 deletions...ManyToMany/Publish/DataSet/localizeCategoryOfRelation.csv
- typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/PublishAll/DataSet/localizeCategoryOfRelation.csv 1 addition, 3 deletions...yToMany/PublishAll/DataSet/localizeCategoryOfRelation.csv
Please register or sign in to comment