Review main Merged

71404[BUGFIX] Reduce DB queries for HMENU with external URLs

Benni Mack CR +2 V +2 Easy +5 −15 updated 10/05/21, 07:03

Commit message

For historical reasons, HMENU created links to external URLs
by calling typolink() twice.
This is because HMENU did not always use the official typolink()
method in the past (TYPO3 4.x/TYPO3 6.x).

Because typolink() now provides much more information,
the additional round-trip around typolink() can be removed
as typolink() already provides this information directly now.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Wouter Wolters +1
    • Nikita Hovratov +1
    • Andreas Kienast +1
  • Verified V +2 Done
    • Benni Mack +2
    • Nikita Hovratov +1
    • Andreas Kienast +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 1011

  1. Benni Mack uploaded patch set 1 10/01/21, 13:24

  2. core-ci voted on patch set 1 V +1 10/01/21, 13:47 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17432

  3. Andreas Kienast voted on patch set 1 CR +1 10/01/21, 13:52

  4. Andreas Kienast commented on patch set 1 10/01/21, 13:53

    How do you find these things?
  5. Benni Mack commented on patch set 1 10/03/21, 14:32

    Actually, it's not always an additional DB query, but for sure a duplicate code execution.

    Reply

    browsing through the source code :D In general, there a bunch of issues/bugs related to HMENU and typolink. typolink() and HMENU link generation were much different in v4, but get closer more and more, and this is one of the things which is still a leftover from the derivative. Since I was involved in the splitting up of typolink() into custom "LinkHandler" I come back to this class every once in a while and see how things went. Unfortunately we only have a few tests for HMENU, but a great deal of typolink() functional tests.
  6. Wouter Wolters voted on patch set 1 CR +1 10/04/21, 17:43

  7. Andreas Kienast voted on patch set 1 V +1 10/04/21, 21:16

  8. Nikita Hovratov commented on patch set 1 10/05/21, 06:53

    AbstractMenuContentObject.php:1293

    Don't know if this is important, but E-Mail links won't get their target removed anymore. It's probably fine though.
  9. Nikita Hovratov voted on patch set 1 V +1 CR +1 10/05/21, 06:54

  10. Benni Mack commented on patch set 1 V +2 CR +2 10/05/21, 07:03

    AbstractMenuContentObject.php:1293 Reply

    yes. the email links should get their target properly removed in the Email Link Builder
  11. Benni Mack merged patch set 2 10/05/21, 07:03