Review main Merged

84427[BUGFIX] Do not fail on link generation in backend context

Georg Ringer CR +2 V +2 Easy +5 −1 updated 12/18/24, 14:26

Commit message

The `DatabaseRecordLinkBuilder` may be invoked in a backend context
(e.g., through a typolink ViewHelper), where the necessary
`frontend.page.information` attribute is not available.

To prevent null pointer exceptions when accessing page TsConfig,
an early return has been implemented.

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • Torben Hansen +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Torben Hansen +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 1723

  1. Georg Ringer uploaded patch set 1 05/27/24, 20:11

  2. Georg Ringer commented on patch set 1 05/27/24, 20:12

    This change is ready for review.
  3. core-ci voted on patch set 1 V -1 05/27/24, 20:19 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58352

  4. Georg Ringer uploaded patch set 2 V -1 05/27/24, 20:28

  5. core-ci voted on patch set 2 V +1 05/27/24, 20:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58354

  6. Torben Hansen voted on patch set 2 CR +1 V +1 05/28/24, 17:33

  7. Stefan Bürk commented on patch set 2 05/28/24, 23:45

    DatabaseRecordLinkBuilder.php:132

    Don't we miss the full rootline in that case, specially if it is not in the runtime cache ?
  8. Georg Ringer commented on patch set 2 05/29/24, 04:46

    we will for sure miss information but there is not even a page id to build a rootline in the backend and just using the BE domain to retrieve e.g. the 1st site is not an option either :/
  9. Torben Hansen commented on patch set 2 06/01/24, 09:29

    Reply

    Maybe this https://github.com/TYPO3/typo3/blob/main/typo3/sysext/frontend/Classes/Typolink/AbstractTypolinkBuilder.php#L196 is the missing brick here (expecially the part with TypoLink and backend context). Since we in v13 can not use TSFE->id any more, the whole TSFE fallback logic for backend context in `AbstractTypolinkBuilder` can maybe be removed. But in general, this patch look good to me.
  10. Georg Ringer rebased onto patch set 3 CR +1 V +1 12/18/24, 11:50

  11. Oli Bartsch updated the commit message in patch set 4 12/18/24, 11:51

  12. Benni Mack commented on patch set 4 12/18/24, 11:53

    DatabaseRecordLinkBuilder.php:132 Reply

    in BE you don't have it, so we take the root page of the site, whereas on the rootlevel this is just the one page record anyways, I assume.
  13. core-ci voted on patch set 3 V +1 12/18/24, 11:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/71372

  14. core-ci voted on patch set 4 V +1 12/18/24, 11:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/71373

  15. Oli Bartsch uploaded patch set 5 V +1 12/18/24, 12:08

  16. Oli Bartsch voted on patch set 5 CR +1 V +1 12/18/24, 12:08

  17. core-ci voted on patch set 5 V -1 12/18/24, 12:15 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/71374

  18. Torben Hansen uploaded patch set 6 CR +1 V +1 12/18/24, 12:25

  19. Torben Hansen voted on patch set 6 CR +1 V +1 12/18/24, 12:26

  20. core-ci voted on patch set 6 V +1 12/18/24, 12:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/71377

  21. Oli Bartsch voted on patch set 6 CR +1 V +1 12/18/24, 12:44

  22. Oli Bartsch commented on patch set 6 CR +2 V +2 12/18/24, 14:26

    Reply

    Done

    DatabaseRecordLinkBuilder.php:132 Reply

    Done
  23. Oli Bartsch merged patch set 7 12/18/24, 14:26