Review main Merged

82752[BUGFIX] Prevent exception in TranslateViewHelper for modules without short description

Albrecht Köhnlein CR +2 V +2 Easy +5 −1 updated 02/01/24, 07:47

Commit message

In case modules do not provide a "shortDescription" the module card is
now rendered without title in the "About" module

Review

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

Issues 1

Files 1

Review log 89

  1. Albrecht Köhnlein uploaded patch set 1 01/31/24, 13:35

  2. core-ci voted on patch set 1 V +1 01/31/24, 13:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52557

  3. Garvin Hicking commented on patch set 1 01/31/24, 16:15

    For the curious like me, no, this doesn't work: ``` title="{f:if(condition: subModule.shortDescription, then: '{f:translate(key: \'{subModule.shortDescription}\', default: \'{subModule.shortDescription}\')}', else: '')}" ``` :D
  4. Albrecht Köhnlein commented on patch set 1 01/31/24, 16:57

    Reply

    Was also my first idea. But unfortunately no. It did not work. Turned out, the `then` argument was rendered but simply not returned. For this reason, I decided to solve it similar to https://review.typo3.org/c/Packages/TYPO3.CMS/+/77257
  5. Garvin Hicking commented on patch set 1 CR +1 V +1 01/31/24, 16:59

    Ack! Your patch does work for me. :-)

    Reply

    Acknowledged
  6. Oli Bartsch commented on patch set 1 01/31/24, 20:38

    Modules.html:19

    Do you know whether an empty title attribute is better than omitting the attribute altogether in case no shortDescription is given?
  7. Albrecht Köhnlein commented on patch set 1 02/01/24, 07:40

    Modules.html:19 Reply

    As you can see in this MDN example https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/title#title_attribute_inheritance the difference between an empty title attribute and no title attribut is only relevant for inheritance. So in this current case, it does not make a difference. But if you would like to, I could refactor it. But in firt place, I simply decided to solve it like https://review.typo3.org/c/Packages/TYPO3.CMS/+/77257
  8. Oli Bartsch commented on patch set 1 CR +2 V +2 02/01/24, 07:47

    Modules.html:19 Reply

    Oke, let's make it this way. However, we should anyways reconsider this code as a-tags with empty target are better buttons. But one fix at a time. Thanks for your patch!
  9. Oli Bartsch merged patch set 2 02/01/24, 07:47