Review main Merged

84040[TASK] Return more record info in RelationHandler->readMM()

Christian Kuhn CR +2 V +2 Normal +133 −27 updated 04/26/24, 18:43

Commit message

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.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Garvin Hicking +1
    • Stefan Bürk +1
    • Nikita Hovratov +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Garvin Hicking +1
    • Stefan Bürk +1
    • Nikita Hovratov +1
    • core-ci +1 CI

Issues 1

Files 5

Review log 911

  1. Christian Kuhn uploaded patch set 1 04/26/24, 14:58

  2. core-ci voted on patch set 1 V +1 04/26/24, 15:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56788

  3. Christian Kuhn updated the commit message in patch set 2 V +1 04/26/24, 16:13

  4. Christian Kuhn uploaded patch set 3 04/26/24, 16:15

  5. Christian Kuhn updated the commit message in patch set 4 04/26/24, 16:17

  6. core-ci voted on patch set 4 V +1 04/26/24, 16:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56791

  7. Stefan Bürk voted on patch set 4 CR +1 V +1 04/26/24, 16:44

  8. Garvin Hicking voted on patch set 4 CR +1 V +1 04/26/24, 16:51

  9. Nikita Hovratov voted on patch set 4 CR +1 V +1 04/26/24, 17:27

  10. Christian Kuhn voted on patch set 4 CR +2 V +2 04/26/24, 18:43

  11. Christian Kuhn merged patch set 5 04/26/24, 18:43