Review main Merged

60354[BUGFIX] Use PageTitle API for indexed_search

Jonas Schwabe CR +2 V +2 Easy +30 −0 updated 04/10/19, 09:04

Commit message

The value of indexedDocTitle was not updated when a title had been
generated by the PageTitle API. This simply writes the generated
page title to indexedDocTitle so that it can be used in the
indexed hook.

Review

  • Code review CR +2 Done
    • Richard Haeser +2
    • Oliver Klee +1
  • Verified V +2 Done
    • Richard Haeser +2
    • Oliver Klee +1
    • TYPO3com +1 CI

Issues 1

Files 2

Review log 2026

Show 1 earlier messages
  1. Jonas Schwabe uploaded patch set 1 03/29/19, 17:04

  1. TYPO3com voted on patch set 1 V +1 03/29/19, 17:21 Completed build in 16m 21s on Fri, 29 Mar, 06:21 PM Test Summary: 47257 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33014

  2. Oliver Klee commented on patch set 1 04/01/19, 10:17

    Can we cover this with tests?
  3. Jonas Schwabe commented on patch set 1 04/01/19, 10:49

    > Patch Set 1: > > Can we cover this with tests? A test for generatePageTitle would be fairly easy to write (I can certainly do that), however I don't see much regression potential in generatePageTitle because (hopefully) nobody would remove that line. The problem here was that a new API was introduced and this part was simply not covered, a Unit test checking indexedDocTitle somewhere else would have still succeeded. So a test that makes sure this works even if the page title will be generated somewhere else in the future should be on a higher level I guess. Therefore it would probably make sense to add a functional test for this as well, what do you think?
  4. Oliver Klee commented on patch set 1 04/01/19, 11:11

    > Therefore it would probably make sense to add a functional test for this as well, what do you think? Yes, I agree. > however I don't see much regression potential in generatePageTitle because (hopefully) nobody would remove that line. I see the "hopefully" there. ;-) Generally, if code can be removed and no tests break, the code can be considered to not be important. (Otherwise, cleanup would be impossible if you would need to keep all old code "just in case".)
  5. Jonas Schwabe commented on patch set 1 04/01/19, 11:23

    > Patch Set 1: > I see the "hopefully" there. ;-) Generally, if code can be removed and no tests break, the code can be considered to not be important. (Otherwise, cleanup would be impossible if you would need to keep all old code "just in case".) So I will write two test cases, unit and functional :)
  6. Jonas Schwabe uploaded patch set 2 04/03/19, 21:09

  7. TYPO3com voted on patch set 2 V -1 04/03/19, 21:09 Completed build in 11s on Wed, 3 Apr, 11:09 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33038

  8. Jonas Schwabe uploaded patch set 3 04/03/19, 21:28

  9. Jonas Schwabe commented on patch set 2 04/03/19, 21:28

    > So I will write two test cases, unit and functional :) I had another look at the structure and decided to add a unit test only. Writing a test that operates on a higher level would only help if the page title generation is moved to a different area. But in this case the test cases would be updated as well. This would also not cover new forms of page title generation that get added to generatePageTitel because for those I would need to mock whatever generates this data in the first place. Anyways, I added a unit test case :)
  10. TYPO3com voted on patch set 3 V -1 04/03/19, 21:38 Completed build in 09m 59s on Wed, 3 Apr, 11:39 PM Test Summary: 6 of 47654 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33039

  11. Jonas Schwabe uploaded patch set 4 04/03/19, 21:41

  12. TYPO3com voted on patch set 4 V +1 04/03/19, 21:57 Completed build in 15m 34s on Wed, 3 Apr, 11:57 PM Test Summary: 47261 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33040

  13. Oliver Klee commented on patch set 4 04/04/19, 16:38

    Thanks for the tests! I'll have alook at them and then provide some feedback.
  14. Jörg Bösche voted on patch set 4 CR +1 04/08/19, 13:18

  15. Oliver Klee commented on patch set 4 04/09/19, 13:13

    Jonas, I've provided some feedback and suggested some improvements. Generally, the test already looks very good. And most important: It passes with you change and fails without your change. <3

    TypoScriptFrontendControllerTest.php:479

    Instead of all this text, I propose to use an @see annotation with the ticket URL.

    TypoScriptFrontendControllerTest.php:483

    Let's make this a sentence stating the expected behavior. My suggestion: indexedSearchHookUsesPageTitleApi And while we're creating a new test, please let's use the ": void" return type declaration.

    TypoScriptFrontendControllerTest.php:485

    I suggest we shorten this to $pageTitle.

    TypoScriptFrontendControllerTest.php:492

    Generally, in tests you don't need to use makeInstance (unless you are testing the makeInstance method). new will do just fine.

    TypoScriptFrontendControllerTest.php:499

    Generally, I recommend using assertSame as much as possible as this will also catch type errors.

    TypoScriptFrontendControllerTest.php:502

    Usually, there is no need to provide an assertion message (especially if there is only one assertion in a test (which I recommend)).
  16. Georg Ringer voted on patch set 4 V +1 CR +1 04/09/19, 14:26

  17. Jörg Bösche uploaded patch set 5 04/10/19, 08:45

  18. TYPO3com voted on patch set 5 V -1 04/10/19, 08:46 Completed build in 11s on Wed, 10 Apr, 10:46 AM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33158

  19. Jörg Bösche uploaded patch set 6 04/10/19, 08:48

  20. Oliver Klee voted on patch set 6 CR +1 04/10/19, 08:51

  21. Oliver Klee voted on patch set 6 V +1 04/10/19, 08:51

  22. Richard Haeser commented on patch set 6 V +1 CR +1 04/10/19, 08:55

    When Bamboo is succeeding, I will change my +1 to a +2
  23. TYPO3com voted on patch set 6 V +1 04/10/19, 09:04 Completed build in 15m 53s on Wed, 10 Apr, 11:04 AM Test Summary: 47271 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33159

  24. Richard Haeser voted on patch set 6 V +2 CR +2 04/10/19, 09:04

  25. Richard Haeser merged patch set 7 04/10/19, 09:04