Review main Merged

81405[BUGFIX] Use telephone as fallback for link text

Michael Hitzler CR +2 V +2 Normal +75 −0 updated 03/13/24, 09:07

Commit message

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 2

Review log 1926

Show 1 earlier messages
  1. Michael Hitzler uploaded patch set 1 10/10/23, 15:12

  1. Michael Hitzler uploaded patch set 2 10/10/23, 15:14

  2. core-ci voted on patch set 1 V -1 10/10/23, 15:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47654

  3. core-ci voted on patch set 2 V +1 10/10/23, 15:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47655

  4. Oliver Klee commented on patch set 2 10/10/23, 15:57

    Looks in general quite good! I've added some comments concerning array accesses and the tests.

    TelephoneLinkBuilder.php:27

    Do we need to check if `$linkDetails['telephone']` is set here?

    TelephoneLinkBuilderTest.php:28

    I propose naming tests so that they form a complete (short) sentence with a statement about the tested behavior: https://speakerdeck.com/oliverklee/test-driven-development-with-phpunit-915a5f2c-3d37-4e41-b5bc-ef1efca9c01e?slide=39

    TelephoneLinkBuilderTest.php:37

    These two assertions are two separate pieces of behavior. I propose making two separate tests for this. (Ditto for the other test.)

    TelephoneLinkBuilderTest.php:38

    For tests, I generally recommend to use the strictest (or most specific) test possible, i.e., `assertSame` instead of `assertEquals` where possible.
  5. Daniel Siepmann uploaded patch set 3 V +1 10/11/23, 13:36

  6. Daniel Siepmann commented on patch set 3 10/11/23, 13:39

    TelephoneLinkBuilder.php:27 Reply

    I guess it will always be set. But this is a public class and it might be called by 3rd party code. So I've added a fallback, thanks.

    TelephoneLinkBuilderTest.php:28 Reply

    I hope the changes now are better suited?

    TelephoneLinkBuilderTest.php:37 Reply

    I've reduced to a single assert per test. Thanks.

    TelephoneLinkBuilderTest.php:38 Reply

    We've copied the PageLinkBuilderTest as a base which used them. But I've updated as I also think more specific is better.
  7. core-ci voted on patch set 3 V +1 10/11/23, 13:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47684

  8. Oliver Klee commented on patch set 3 V +1 CR +1 10/11/23, 14:05

    TelephoneLinkBuilderTest.php:28 Reply

    Yes, a lot better. Thanks!
  9. Garvin Hicking commented on patch set 3 V +1 10/11/23, 15:07

    Could it be a valid case that integrators want to provide a link with no actual text (i.e. because they use CSS to style the link, use a button and title/attributes?) The way I read the fallback code, you wouldn't be able to pass an empty string like '' into it to receive something like: <a href="tel:0190331332" class="bootstrap-phone"></a> (Not an expert on the LinkBuilders, so if that wouldn't be used when generating such a link, I'm sorry, then just disregard)
  10. Daniel Siepmann commented on patch set 3 10/11/23, 15:09

    Reply

    I don't know. The change now streamlines the handling to work the same as existing links, e.g. Page, Folder, Email, etc. One could use return* in TypoScript or f:uri. Instead of f:link to build the a-Tag manual. I'd love to see all links to work the same. That would ease expectations and templates.
  11. Garvin Hicking commented on patch set 3 CR +1 10/11/23, 16:07

    Alright! :-)

    Reply

    Ack
  12. Garvin Hicking updated the commit message in patch set 4 CR +1 V +1 03/12/24, 20:58

  13. Garvin Hicking commented on patch set 4 CR +1 V +1 03/12/24, 20:59

    Adjusted to not backport to 11.5, I think this doesn't qualify for priority bugfix. Would be nice if we could get this merged for main&12!
  14. Oliver Klee voted on patch set 4 CR +1 V +1 03/12/24, 21:15

  15. core-ci voted on patch set 4 V -1 03/13/24, 00:00 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54446

  16. Oli Bartsch commented on patch set 4 CR -1 03/13/24, 07:37

    Metadata found in doc-comment for method TYPO3\CMS\Frontend\Tests\Unit\Typolink\TelephoneLinkBuilderTest::respectsProvidedLinkParameter(). Metadata in doc-comments is deprecated and will no longer be supported in PHPUnit 12. Update your test code to use attributes instead.
  17. Daniel Siepmann uploaded patch set 5 CR +1 V +1 03/13/24, 07:44

  18. Oli Bartsch commented on patch set 4 CR 0 03/13/24, 07:44

    Reply

    Done
  19. Oli Bartsch uploaded patch set 6 03/13/24, 07:44

  20. core-ci voted on patch set 5 V +1 03/13/24, 07:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54457

  21. core-ci voted on patch set 6 V -1 03/13/24, 07:55 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54458

  22. core-ci voted on patch set 6 V +1 03/13/24, 08:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54458

  23. Garvin Hicking commented on patch set 6 CR +1 V +1 03/13/24, 08:38

    (Restarted the CI job, seems that was a random selenium fluke)
  24. Oli Bartsch voted on patch set 6 CR +2 V +2 03/13/24, 09:07

  25. Oli Bartsch merged patch set 7 03/13/24, 09:07