Review main Merged

56015[BUGFIX] RootlineUtility only resolves defined relation fields

Benni Mack CR +2 V +2 Easy +22 −1 updated 03/06/18, 06:43

Commit message

The RootlineUtility first selects all fields, which have been added
via the config option "addRootLineFields". After that, it iterates
over all(!) columns that are defined as relation.

The change modifies the loop so that only relations are resolved for
field pages.media (predefined) and those fields that have been added
to $GLOBALS[TYPO3_CONF_VARS][FE][addRootLineFields].

Review

  • Code review CR +2
    • Jigal van Hemert +2
    • Georg Ringer +1
    • Markus Klein +1
    • Frans Saris +1
  • Verified V +2
    • Jigal van Hemert +2
    • Georg Ringer +1
    • TYPO3com +1 CI

Issues 1

Files 2

Review log 2430

Show 45 earlier messages
  1. Benni Mack uploaded patch set 1 03/05/18, 18:50

  2. TYPO3com voted on patch set 1 V +1 03/05/18, 18:59 Completed build in 09m 21s on Mon, 5 Mar, 07:59 PM Test Summary: 30806 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-20551

  3. Mathias Schreiber voted on patch set 1 V +1 CR +1 03/05/18, 19:52

  4. Anja Leichsenring voted on patch set 1 V +1 CR +1 03/05/18, 20:08

  5. Oliver Hader commented on patch set 1 CR -1 03/05/18, 20:17

    On it...

    RootlineUtility.php:288

    isset() and !empty() does probably the same here - !empty is enough
  1. Anja Leichsenring uploaded patch set 2 03/05/18, 20:20

  2. Anja Leichsenring voted on patch set 2 V +1 CR +1 03/05/18, 20:21

  3. Oliver Hader commented on patch set 1 03/05/18, 20:23

    Important-84144-RootlineUtilityIsEnrichingOnlyProperlySelectedRelationalDatabaseFields.rst:12

    The fields defined in addRootLineFields have been resolved only prior to this patch already...
  4. Benni Mack commented on patch set 1 03/05/18, 20:28

    Important-84144-RootlineUtilityIsEnrichingOnlyProperlySelectedRelationalDatabaseFields.rst:12 Reply

    nope.
  5. TYPO3com voted on patch set 2 V +1 03/05/18, 20:29 Completed build in 08m 22s on Mon, 5 Mar, 09:29 PM Test Summary: 30806 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-20557

  6. Benni Mack commented on patch set 3 03/05/18, 20:42

    Published edit on patch set 2.
  7. Benni Mack updated the commit message in patch set 4 03/05/18, 20:43

  8. Markus Klein commented on patch set 4 03/05/18, 20:52

    RootlineUtility.php:288

    I'm questioning the empty function here. This means that if (for whatever reason) the refindex didn't set the relation count, we do not evaluate the relation. Since my POV is that the "nice to have number of relation" has just informational character, I wouldn't rely on it. Hence, I would suggest to switch this to isset() only here.
  9. TYPO3com voted on patch set 3 V +1 03/05/18, 20:54 Completed build in 11m 46s on Mon, 5 Mar, 09:54 PM Test Summary: 30806 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-20560

  10. TYPO3com voted on patch set 4 V +1 03/05/18, 20:56 Completed build in 12m 54s on Mon, 5 Mar, 09:56 PM Test Summary: 30806 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-20561

  11. Oliver Hader uploaded patch set 5 03/05/18, 21:12

  12. Oliver Hader commented on patch set 5 03/05/18, 21:15

    RootlineUtility.php:288 Reply

    After thinking a while again about that, I've modified that to an array_key_exists - since the value could also be NULL if we consider the reference count only as "cosmetical" information. However, there might be other places in the core that rely on that reference count.
  13. Oliver Hader voted on patch set 5 V +1 CR +1 03/05/18, 21:17

  14. TYPO3com voted on patch set 5 V +1 03/05/18, 21:20 Completed build in 08m 18s on Mon, 5 Mar, 10:20 PM Test Summary: 30806 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-20562

  15. Markus Klein voted on patch set 5 CR +1 03/05/18, 22:22

  16. Markus Klein updated the commit message in patch set 6 03/05/18, 22:22

  17. Markus Klein commented on patch set 6 CR +1 03/05/18, 22:23

    As discussed with Benni, scheduled this for 8.7 too
  18. TYPO3com voted on patch set 6 V +1 03/05/18, 22:31 Completed build in 08m 10s on Mon, 5 Mar, 11:31 PM Test Summary: 30806 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-20563

  19. Frans Saris commented on patch set 6 03/05/18, 23:10

    Isn't this a breaking change? One could now rely on the fact that relation fields are added to the rootline without defining this properly
  20. Benni Mack commented on patch set 6 03/06/18, 05:24

    @Frans: It is - probably with every bugfix. Just to let you know: Without this fix, the rootline utility resolves sys_category MM tables for EVERY page of EVERY rootline (until populated in cache_rootline), even if pages.categories is not part of addRootLineFields and even if pages.categories is empty. In my use case, a menu with 100 links (as separate pagetype) fell down from 2000 SQL queries to 1000 (with empty cache_rootline). Question is if you want that in v8 as well. I'm fine with having this in master-only, as I will definitively patch all of my installations anyways.
  21. Frans Saris commented on patch set 6 CR +1 03/06/18, 06:12

    I'm fine with having this in 8.7. rather not patch my instances ;) As it's not consistent (only false for relational fields) I expect the impact to be low.
  22. Georg Ringer voted on patch set 6 V +1 CR +1 03/06/18, 06:29

  23. Jigal van Hemert voted on patch set 6 V +2 CR +2 03/06/18, 06:43

  24. Jigal van Hemert merged patch set 7 03/06/18, 06:43

  25. Jigal van Hemert commented on patch set 7 03/06/18, 06:43

    Cherry Picked This patchset was cherry picked to branch TYPO3_8-7 as commit 4741f373c71e866e7e78cb87b8789e4dc0326809