[BUGFIX] Avoid dangling MM relations on workspace publish
When publishing workspace records with connected "true" MM relations (uid_local / uid_foreign columns and no TCA for that table), DataHandler triggers bugs: * It updates uid_local or uid_foreign rows to negative uids during the process as intermediate DB state. * It leaves "dangling" MM rows of the workspace record that has been pushed live. The involved code is relatively well encapsulated, it only kicks in for this "publish MM relations" scenario, the impact of this patch is limited to this area. The patch rewrites MM workspace publish handling: * Avoid parking state in a DataHandler class property only used in this scenario. * Avoid moving a list of stateful RelationHandler instances around and dynamically calling methods on those instances. * Avoid recursive flex form MM publish handling with indirect callback methods that change class state. * Obsolete a RelationHandler method used only in this scenario. * Reduce number of queries. The result is a simplified, better encapsulated and well commented solution. On a testing side, the patch brings a scenario to verify flex form MM relation handling. An according styleguide example is pending, too. This patch allows us to change auto created MM table definitions to unsigned uid_local and uid_foreign columns, which is of course the right way to go. Change-Id: I0d24f31cbd356f19937c2f8c18d432424e127b97 Resolves: #95275 Resolves: #81718 Releases: master Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/71097 Tested-by:core-ci <typo3@b13.com> Tested-by:
Stefan Bürk <stefan@buerk.tech> Tested-by:
Benni Mack <benni@typo3.org> Tested-by:
Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by:
Stefan Bürk <stefan@buerk.tech> Reviewed-by:
Benni Mack <benni@typo3.org> Reviewed-by:
Christian Kuhn <lolli@schwarzbu.ch>
Showing
- typo3/sysext/core/Classes/Configuration/FlexForm/FlexFormTools.php 2 additions, 2 deletions...ext/core/Classes/Configuration/FlexForm/FlexFormTools.php
- typo3/sysext/core/Classes/DataHandling/DataHandler.php 120 additions, 101 deletionstypo3/sysext/core/Classes/DataHandling/DataHandler.php
- typo3/sysext/core/Classes/Database/RelationHandler.php 9 additions, 3 deletionstypo3/sysext/core/Classes/Database/RelationHandler.php
- typo3/sysext/core/Classes/Database/Schema/DefaultTcaSchema.php 2 additions, 6 deletions.../sysext/core/Classes/Database/Schema/DefaultTcaSchema.php
- typo3/sysext/core/Documentation/Changelog/master/Deprecation-95275-RelationHandler-remapMM.rst 36 additions, 0 deletions...elog/master/Deprecation-95275-RelationHandler-remapMM.rst
- typo3/sysext/core/Tests/Functional/DataHandling/SelectFlex/AbstractActionTestCase.php 74 additions, 0 deletions...tional/DataHandling/SelectFlex/AbstractActionTestCase.php
- typo3/sysext/core/Tests/Functional/DataHandling/SelectFlex/DataSet/ImportDefault.csv 30 additions, 0 deletions...ctional/DataHandling/SelectFlex/DataSet/ImportDefault.csv
- typo3/sysext/core/Tests/Functional/DataHandling/SelectFlex/Modify/ActionTest.php 46 additions, 0 deletions.../Functional/DataHandling/SelectFlex/Modify/ActionTest.php
- typo3/sysext/core/Tests/Functional/DataHandling/SelectFlex/Modify/DataSet/addElementRelation.csv 32 additions, 0 deletions...Handling/SelectFlex/Modify/DataSet/addElementRelation.csv
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_select_flex_mm/Configuration/TCA/tx_testselectflexmm_foreign.php 84 additions, 0 deletions...flex_mm/Configuration/TCA/tx_testselectflexmm_foreign.php
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_select_flex_mm/Configuration/TCA/tx_testselectflexmm_local.php 115 additions, 0 deletions...t_flex_mm/Configuration/TCA/tx_testselectflexmm_local.php
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_select_flex_mm/Resources/Public/Icons/Extension.gif 0 additions, 0 deletions.../test_select_flex_mm/Resources/Public/Icons/Extension.gif
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_select_flex_mm/ext_emconf.php 23 additions, 0 deletions...al/Fixtures/Extensions/test_select_flex_mm/ext_emconf.php
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_select_flex_mm/ext_tables.php 10 additions, 0 deletions...al/Fixtures/Extensions/test_select_flex_mm/ext_tables.php
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_select_flex_mm/ext_tables.sql 19 additions, 0 deletions...al/Fixtures/Extensions/test_select_flex_mm/ext_tables.sql
- typo3/sysext/core/Tests/Unit/Database/Schema/DefaultTcaSchemaTest.php 6 additions, 0 deletions.../core/Tests/Unit/Database/Schema/DefaultTcaSchemaTest.php
- typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallMatcher.php 7 additions, 0 deletions.../Configuration/ExtensionScanner/Php/MethodCallMatcher.php
- typo3/sysext/workspaces/Classes/Hook/DataHandlerHook.php 1 addition, 2 deletionstypo3/sysext/workspaces/Classes/Hook/DataHandlerHook.php
- typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Publish/DataSet/addCategoryRelation.csv 2 additions, 4 deletions...ndling/ManyToMany/Publish/DataSet/addCategoryRelation.csv
- typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Publish/DataSet/changeCategoryRelationSorting.csv 2 additions, 4 deletions...yToMany/Publish/DataSet/changeCategoryRelationSorting.csv
Please register or sign in to comment