Review main Merged

61508[BUGFIX] Improve finding the correct realurl cache entry to create slug

Albrecht Köhnlein CR +2 V +2 Easy +12 −2 updated 09/11/19, 13:55

Commit message

Respect the `expire` field when selecting realurl cache data to generate
page slugs from realurl cache.
And also only the first found result will be used to simulate original
behavior of realurl, where `exec_SELECTgetSingleRow()` with internal
LIMIT 1 is used.

Review

  • Code review CR +2 Done
    • Susi Moog +2
    • Frank Nägler +1
    • Richard Haeser +1
  • Verified V +2 Done
    • Susi Moog +2
    • Frank Nägler +1
    • TYPO3com +1 CI

Issues 1

Files 1

Review log 2427

Show 12 earlier messages
  1. Albrecht Köhnlein uploaded patch set 1 08/16/19, 15:12

  2. TYPO3com voted on patch set 1 V -1 08/16/19, 15:13 Completed build in 11s on Fri, 16 Aug, 03:13 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35724

  1. Albrecht Köhnlein uploaded patch set 2 08/16/19, 15:33

  2. TYPO3com voted on patch set 2 V +1 08/16/19, 15:44 Completed build in 10m 29s on Fri, 16 Aug, 03:44 PM Test Summary: 47211 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35725

  3. Georg Ringer voted on patch set 2 V +1 CR +1 08/16/19, 18:16

  4. Josef Glatz voted on patch set 2 CR +1 08/16/19, 18:24

  5. Guido Schmechel voted on patch set 2 CR +1 08/17/19, 12:42

  6. Anja Leichsenring commented on patch set 2 08/19/19, 07:08

    does the term 'realurl' actually refer to the extension long used for human readable url creation and no longer required after introduction of routing, or is this an adaption? To be honest, I would recommend to not use this term 'realurl' in any context but the extension. It is confusing.
  7. Andreas Kienast commented on patch set 2 08/19/19, 07:47

    > Patch Set 2: > > does the term 'realurl' actually refer to the extension long used for human readable url creation and no longer required after introduction of routing, or is this an adaption? Well, the patch indeed aims to improve slug generation based on data of EXT:realurl, so I think the term is correct.
  8. Andreas Wolf commented on patch set 2 08/19/19, 10:02

    PopulatePageSlugs.php:235

    Isn't it dangerous to use only the first result if there is no sorting applied in the query?
  9. Albrecht Köhnlein commented on patch set 2 08/20/19, 05:09

    > Patch Set 2: > > (1 comment)

    PopulatePageSlugs.php:235 Reply Unresolved

    I tried to adapt the original behavior of EXT:realurl where I found `exec_SELECTgetSingleRow()` without ordering inside the method `DatabaseCache::getPathFromCacheByPageId()`. And in my local tests it returned the expected records. So I guess, it's a strange looking but correct behavior. https://github.com/dmitryd/typo3-realurl/blob/27dfbc236d6d3cc7f99cea183e618aea1e9f269d/Classes/Cache/DatabaseCache.php#L286
  10. Joerg Kummer commented on patch set 2 V +1 CR +1 08/22/19, 12:15

    Verified. Tested with data from a real project, just pages of doctype 'spacer' (199) and 'folder' 254 still got numbers...
  11. Frank Nägler commented on patch set 2 CR -1 08/23/19, 09:41

    PopulatePageSlugs.php:227

    please use the Context object to get the DateTimeAspect and use this instead of the time() function.
  12. Albrecht Köhnlein uploaded patch set 3 08/23/19, 09:49

  13. TYPO3com voted on patch set 3 V +1 08/23/19, 10:09 Completed build in 19m 29s on Fri, 23 Aug, 10:09 AM Test Summary: 47211 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35791

  14. Frank Nägler voted on patch set 3 CR +1 08/23/19, 10:17

  15. Guido Schmechel commented on patch set 3 08/26/19, 10:41

    PopulatePageSlugs.php:227 Reply Unresolved

    Frank: Can you explain me why this aspect is the right way? Thanks :-)
  16. Tymoteusz Motylewski commented on patch set 3 08/27/19, 21:35

    what if the only slug we have in db is already expired? It will not be found/used? I think in case we don't have a non expired slug available an expired one can be used.
  17. Frank Nägler voted on patch set 3 V +1 09/06/19, 12:12

  18. Richard Haeser voted on patch set 3 CR +1 09/06/19, 15:13

  19. Tymoteusz Motylewski commented on patch set 3 CR -1 09/06/19, 19:55

    I would like to get answer to my comment before it gets in.
  20. Albrecht Köhnlein commented on patch set 3 09/07/19, 07:14

    > Patch Set 3: > > what if the only slug we have in db is already expired? It will not be found/used? > I think in case we don't have a non expired slug available an expired one can be used. Thanks for your feedback and sorry for my late reply. I thought about this a while and I'm still not sure, if we really need this. If a page only has expired realurl cache records, the method `getSuggestedSlugs()` will not return a suggested slug for this page. That means, in the further process, a new slug will be generated by `SlugHelper::generate()` what seems to be OK for me. My intention for this patch was to prevent old/outdated realurl cache entries being used as pages slugs. So I guess, it's ok, when a new slug would be generated from scratch for a page with only expired realurl cache entries.
  21. Tymoteusz Motylewski commented on patch set 3 CR 0 09/07/19, 11:49

    I see your point. I think that if there was a realurl slug in any point of time somebody might have used it (eg on social media). The patch improves the situation anyway so i remove -1
  22. Joerg Kummer commented on patch set 3 09/07/19, 14:11

    > Patch Set 3: -Code-Review > > I see your point. I think that if there was a realurl slug in any point of time somebody might have used it (eg on social media). The patch improves the situation anyway so i remove -1 Thx Tymoteusz. I also agree to substantiation by Albrecht
  23. Anja Leichsenring wrote 09/09/19, 13:34

    Removed reviewer Anja Leichsenring.
  24. Susi Moog voted on patch set 3 V +2 CR +2 09/11/19, 13:55

  25. Susi Moog merged patch set 4 09/11/19, 13:55