Review main Merged

59167[FEATURE] Fallback options for slug fields

Guido Schmechel CR +2 V +2 Normal +211 −7 updated 03/01/19, 15:10

Commit message

Now it is possible to define several fields with fallback function for
the generatorOptions fields.

Review

  • Code review CR +2 Done
    • Anja Leichsenring +2
    • Sebastian Rosskopf +1
    • Martin Kutschker +1
    • André Buchmann +1
  • Verified V +2 Done
    • Anja Leichsenring +2
    • Sebastian Rosskopf +1
    • André Buchmann +1
    • TYPO3com +1 CI

Issues 1

Files 4

Review log 4255

Show 2130 earlier messages
  1. Guido Schmechel uploaded patch set 1 12/16/18, 11:41

  2. Guido Schmechel uploaded patch set 2 12/16/18, 11:41

  3. Guido Schmechel uploaded patch set 3 12/16/18, 11:47

  4. TYPO3com voted on patch set 1 V +1 12/16/18, 11:53 Completed build in 12m 34s on Sun, 16 Dec, 12:53 PM Test Summary: 48776 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-30736

  5. TYPO3com voted on patch set 2 V +1 12/16/18, 11:54 Completed build in 12m 19s on Sun, 16 Dec, 12:54 PM Test Summary: 48776 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-30737

  6. TYPO3com voted on patch set 3 V +1 12/16/18, 11:58 Completed build in 10m 46s on Sun, 16 Dec, 12:58 PM Test Summary: 48776 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-30738

  7. Guido Schmechel uploaded patch set 4 12/16/18, 16:25

  8. TYPO3com voted on patch set 4 V +1 12/16/18, 16:35 Completed build in 10m 35s on Sun, 16 Dec, 05:35 PM Test Summary: 48776 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-30742

  9. Guido Schmechel uploaded patch set 5 12/16/18, 16:44

  10. TYPO3com voted on patch set 5 V +1 12/16/18, 16:55 Completed build in 10m 19s on Sun, 16 Dec, 05:55 PM Test Summary: 48780 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-30743

  11. Mathias Brodala commented on patch set 5 12/17/18, 09:54

    SlugHelperTest.php:479

    Why not make this multiple items in the array instead?
  12. Guido Schmechel commented on patch set 5 12/17/18, 10:39

    SlugHelperTest.php:479 Reply

    Hopefully I understand you correct: Multiple Array is used for combining fields. See: https://docs.typo3.org/typo3cms/TCAReference/ColumnsConfig/Type/Slug.html#generatoroptions 'Field A', 'Field C' => "slugA-slugC" 'Field A // Field B', 'Field C' => "slugA-slugC" OR "slugB-slugC"
  13. Mathias Brodala commented on patch set 5 12/17/18, 10:44

    SlugHelperTest.php:479 Reply

    Ah yes indeed, forgot about that. In this case I'd still prefer an array approach: fields => [ 'field1', ['field2', 'otherfield2'] ] So basically a nested array. This way we can avoid string parsing.
  14. Guido Schmechel commented on patch set 5 12/17/18, 10:50

    > Patch Set 5: > > (1 comment)

    SlugHelperTest.php:479 Reply

    Sounds good :-) And this is more readable for you then a "new" fallback Option? Example: 'generatorOptions' => [ 'field' => ['title', 'subtitle'] 'fieldFallback => [null, 'nav_title'] ]; Just searching for the best integrator solution.
  15. Mathias Brodala commented on patch set 5 12/17/18, 11:06

    SlugHelperTest.php:479 Reply

    Of course it's not that nice to read. But a separate option would be unclear to what field the fallback applies. Having to fill up empty placeholders ain't that nice either.
  16. Guido Schmechel commented on patch set 5 12/17/18, 11:56

    SlugHelperTest.php:479 Reply

    Thanks for your feedback. I will rewrite the patch and then we wait for further feedback.
  17. Guido Schmechel voted on patch set 5 CR -1 12/17/18, 12:48

  18. Guido Schmechel uploaded patch set 6 12/17/18, 21:17

  19. TYPO3com voted on patch set 6 V +1 12/17/18, 21:28 Completed build in 11m 05s on Mon, 17 Dec, 10:28 PM Test Summary: 48796 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-30779

  20. Guido Schmechel commented on patch set 6 12/17/18, 21:52

    SlugHelperTest.php:529 Unresolved

    Hmpf!
  21. Benjamin Gries voted on patch set 6 V +1 CR +1 01/08/19, 10:49

  22. Guido Schmechel uploaded patch set 7 01/08/19, 22:08

  23. TYPO3com voted on patch set 7 V +1 01/08/19, 22:17 Completed build in 08m 57s on Tue, 8 Jan, 11:17 PM Test Summary: 47665 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-31351

  24. Benni Mack commented on patch set 7 01/09/19, 13:49

    RST file must go in "9.5.x" folder
  25. Guido Schmechel uploaded patch set 8 01/12/19, 08:12

  26. TYPO3com voted on patch set 8 V -1 01/12/19, 08:23 Completed build in 10m 46s on Sat, 12 Jan, 09:23 AM Test Summary: 47675 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-31467

  27. Guido Schmechel uploaded patch set 9 01/13/19, 22:41

  28. TYPO3com voted on patch set 9 V +1 01/13/19, 22:51 Completed build in 09m 05s on Sun, 13 Jan, 11:51 PM Test Summary: 47675 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-31474

  29. Jörg Bösche voted on patch set 9 CR +1 01/31/19, 14:59

  30. Benjamin Gries voted on patch set 9 V +1 CR +1 02/01/19, 08:20

  1. Josef Glatz commented on patch set 9 CR -1 02/01/19, 09:59

    Feature-87085-FallbackOptionsForSlugFields.rst:38

    Please describe how such a configuration will change an url in addition to the code examples. Like a url example before and after.
  2. Benjamin Gries voted on patch set 9 V -1 CR -1 02/01/19, 20:35

  3. Josef Glatz uploaded patch set 10 02/05/19, 06:42

  4. Josef Glatz rebased onto patch set 11 02/05/19, 06:45

  5. Josef Glatz commented on patch set 11 02/05/19, 06:46

    Fixed RsT document: - added correct intendation tabs to spaces - add examples table
  6. TYPO3com voted on patch set 10 V +1 02/05/19, 06:58 Completed build in 15m 11s on Tue, 5 Feb, 07:57 AM Test Summary: 46445 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-32040

  7. TYPO3com voted on patch set 11 V +1 02/05/19, 07:00 Completed build in 14m 53s on Tue, 5 Feb, 08:00 AM Test Summary: 46445 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-32041

  8. Guido Schmechel voted on patch set 11 V +1 CR +1 02/09/19, 14:16

  9. Guido Schmechel wrote 02/11/19, 12:24

    Removed Verified+1 by Guido Schmechel <guido.schmechel@brandung.de>
  10. Guido Schmechel wrote 02/11/19, 12:24

    Removed Code-Review+1 by Guido Schmechel <guido.schmechel@brandung.de>
  11. Mark Kirstein commented on patch set 11 02/12/19, 06:58

    I had a similar problem after upgrading to 9.5 from 7.6 with realUrl. RealUrl took the nav_title and if not empty and as fallback the title of page. I solved it with Xclass SlugHelper with a simple extension and two steps: In ext_tables.php set the order of fields: $GLOBALS['TCA']['pages']['columns']['slug']['config']['generatorOptions']['fields'][0] = 'nav_title'; $GLOBALS['TCA']['pages']['columns']['slug']['config']['generatorOptions']['fields'][1] = 'title'; In Xclass SlugHelper.php just add a break; within the foreach loop: foreach ($this->configuration['generatorOptions']['fields'] ?? [] as $fieldName) { if (!empty($recordData[$fieldName])) { $pieceOfSlug = $recordData[$fieldName]; $pieceOfSlug = str_replace(array_keys($replaceConfiguration), array_values($replaceConfiguration), $pieceOfSlug); $slugParts[] = $pieceOfSlug; break; } }
  12. Martin Kutschker commented on patch set 11 02/28/19, 16:05

    SlugHelper.php:190

    Do we need the array explosion here? The documentation of the feature doesn't speak of it. And I do't think we need to support both comma separated lists and arrays.

    Feature-87085-FallbackOptionsForSlugFields.rst:27 Unresolved

    "other fields" instead of "a second field" AFAIK the number is not limited

    Feature-87085-FallbackOptionsForSlugFields.rst:34 Unresolved

    a closing ] is missing
  13. Guido Schmechel commented on patch set 11 02/28/19, 18:15

    SlugHelper.php:190 Reply Unresolved

    Hi Martin, this is processed because we can still have single fields as a string. e.g. 'title'. The new feature introduce the possibillity to handle an array ['field1', 'field2']. But we don't want to loose the original string processing to avoid a breaking change.
  14. Guido Schmechel uploaded patch set 12 02/28/19, 18:22

  15. TYPO3com voted on patch set 12 V +1 02/28/19, 18:36 Completed build in 13m 51s on Thu, 28 Feb, 07:36 PM Test Summary: 46617 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-32425

  16. Martin Kutschker voted on patch set 12 CR +1 02/28/19, 21:15

  17. André Buchmann voted on patch set 12 CR +1 03/01/19, 13:48

  18. Sebastian Rosskopf voted on patch set 12 CR +1 03/01/19, 13:56

  19. Anja Leichsenring commented on patch set 13 03/01/19, 14:15

    Published edit on patch set 12.
  20. Martin Kutschker voted on patch set 13 CR +1 03/01/19, 14:18

  21. André Buchmann voted on patch set 13 V +1 CR +1 03/01/19, 14:32

  22. Sebastian Rosskopf voted on patch set 13 V +1 CR +1 03/01/19, 14:32

  23. TYPO3com voted on patch set 13 V +1 03/01/19, 14:51 Completed build in 31m 21s on Fri, 1 Mar, 03:51 PM Test Summary: 46641 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-32462

  24. Anja Leichsenring voted on patch set 13 V +2 CR +2 03/01/19, 15:10

  25. Anja Leichsenring merged patch set 14 03/01/19, 15:10