Skip to content
Snippets Groups Projects
Commit f99d96a5 authored by Christian Kuhn's avatar Christian Kuhn
Browse files

[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: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarGarvin Hicking <gh@faktor-e.de>
Tested-by: default avatarNikita Hovratov <nikita.h@live.de>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarGarvin Hicking <gh@faktor-e.de>
Tested-by: default avatarcore-ci <typo3@b13.com>
Reviewed-by: default avatarNikita Hovratov <nikita.h@live.de>
parent 4cdc4ddf
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment