Review main Abandoned

87884[BUGFIX] Let f:be.link VH soft-fail on RouteNotFoundException (CSP BE)

Garvin Hicking CR 0 V 0 Normal +53 −6 updated 01/27/25, 13:14

Commit message

With #105692 a cross-reference link was added that guides people
to the "Configuration" backend module section for the CSP
configuration.

The used route "system_config" however is set via EXT:lowlevel,
which is not necessarily installed when the CSP backend module
is used.

Unfortunately, using a `<f:be.link>` with a missing route
throws an exception `RouteNotFoundException` that will
crash a whole backend module. This might be the proper
behavior for many cases, to prevent non-working links
in links used for JavaScript or form actions.

In the case of the CSP module however, this purely informational
link could soft-fail and just not return a hyperlink.

To solve this, the `f:be.link` ViewHelper receives a new
boolean argument `softFail` that is set to `false` by default.
Setting it to `true` on specific cases where a link can
drop its `<a href>` context will allow to continue
workflow without the Exception stopping processing.

Tests have been adapted to ensure both recognizing and
handling the exception.

Review

  • Code review CR 0
  • Verified V 0

Issues 2

Files 3

Review log 1012

  1. Garvin Hicking uploaded patch set 1 01/25/25, 20:45

  2. core-ci voted on patch set 1 V -1 01/25/25, 20:51 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73003

  3. Garvin Hicking uploaded patch set 2 V -1 01/25/25, 20:56

    CGL
  4. core-ci voted on patch set 2 V +1 01/25/25, 21:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73004

  5. Sybille Peters commented on patch set 2 01/26/25, 08:53

    Can the said route be moved from EXT:lowlevel to EXT:core? I think the solution now is a bit awkward. Not sure why we need a route defined in EXT:lowlevel, but if this is substantial for core functionality, I think it should be in EXT:core.
  6. Lina Wolf commented on patch set 2 01/26/25, 08:56

    Just soft-failing the link here will probably not do as the complete sentence makes no sense, if the Configuration Module is not available?
  7. Garvin Hicking commented on patch set 2 01/26/25, 09:34

    Reply

    imo the config route and its functionality is coupled to lowlevel.

    Reply

    It does IMI, it says rhen "can be found in rhe configuration module", just not linked.
  8. Lina Wolf commented on patch set 2 01/26/25, 09:36

    Saying "Can be found in the Configuration module" when there is not configuration module sounds confusing to me...
  9. Garvin Hicking commented on patch set 2 01/26/25, 11:06

  10. Andreas Kienast commented on patch set 2 01/27/25, 08:24

    I'M

    Reply Unresolved

    I was about to mention the same point. I think I like the alternative approach more.
  11. Sybille Peters wrote 01/27/25, 08:35

    Removed cc Sybille Peters.
  12. Garvin Hicking abandoned the change 01/27/25, 13:14

    Abandoning in favor of https://review.typo3.org/c/Packages/TYPO3.CMS/+/87885 - conditional based route acccessing in the backend might be better to not "hide" errors.