[TASK] Return more record info in RelationHandler->readMM()
This is a relatively small add-on to RelationHandler when it reads MM relations initiated through start() in readMM(). In general, relations found by the read API are written to $this->itemArray, can be read from there, or further processed. readMM() of course queries the according MM table to find relations. Those MM rows typically have - next to local and foreign "uid" - the foreign table field "fieldname" the relation is attached to, plus both local and foreign sorting values. The patch adds these three to $this->itemArray items, next to existing "tablename" and "uid". This allows us to suppress a useless query to the MM table in consuming code, where sorting fields and foreign fieldname can be important to know - which is the case with an upcoming patch. The patch also cleans up some other details to make the code a bit better readable. Note RelationHandler and its pair class PlainDataResolver in general suffer from these problems: * Both always receive table-uids only and often need to fetch the full record, even though calling code often has the record at hand already. * The result never includes full relation rows but only uids, even if the full row is fetched in various scenarios. * Sorting out invalid workspace records needs additional queries. Together with the messy and hard to understand code including a long list of public properties, the very unfortunate main API start(), and some structural performance issues, a rewrite of RelationHandler and PlainDataResolver becomes more and more pressing. If done right, this would unblock a series of powerful performance improvements for instance in DataHandler. Resolves: #103735 Releases: main Change-Id: I7f793c27b3703cc3ce8bc2213d81d05e676c8823 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/84040 Reviewed-by:Stefan Bürk <stefan@buerk.tech> Tested-by:
Garvin Hicking <gh@faktor-e.de> Tested-by:
Nikita Hovratov <nikita.h@live.de> Reviewed-by:
Christian Kuhn <lolli@schwarzbu.ch> Tested-by:
Christian Kuhn <lolli@schwarzbu.ch> Tested-by:
Stefan Bürk <stefan@buerk.tech> Reviewed-by:
Garvin Hicking <gh@faktor-e.de> Tested-by:
core-ci <typo3@b13.com> Reviewed-by:
Nikita Hovratov <nikita.h@live.de>
Showing
- typo3/sysext/core/Classes/Database/RelationHandler.php 34 additions, 27 deletionstypo3/sysext/core/Classes/Database/RelationHandler.php
- typo3/sysext/core/Tests/Functional/Database/RelationHandlerTest.php 42 additions, 0 deletions...xt/core/Tests/Functional/Database/RelationHandlerTest.php
- typo3/sysext/impexp/Classes/Export.php 9 additions, 0 deletionstypo3/sysext/impexp/Classes/Export.php
- typo3/sysext/impexp/Tests/Functional/Fixtures/XmlExports/irre-records.xml 24 additions, 0 deletions...exp/Tests/Functional/Fixtures/XmlExports/irre-records.xml
- typo3/sysext/impexp/Tests/Functional/Fixtures/XmlImports/irre-records.xml 24 additions, 0 deletions...exp/Tests/Functional/Fixtures/XmlImports/irre-records.xml
Please register or sign in to comment