Review main Merged

66413[BUGFIX] Use the correct PreviewRenderer as fallback

Thomas Löffler CR +2 V +2 Normal +160 −10 updated 01/17/21, 11:22

Commit message

When there is no specific preview renderer defined for
a given subtype, the type-specific renderer can only
be used if it's not an array. Otherwise, the default
preview renderer defined in TCA crtl should be used.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Oli Bartsch +1
  • Verified V +2 Done
    • Benni Mack +2
    • Oli Bartsch +1
    • TYPO3com +1 CI

Issues 1

Files 2

Review log 1420

  1. Thomas Löffler uploaded patch set 1 11/04/20, 07:28

  2. TYPO3com voted on patch set 1 V +1 11/04/20, 07:40 Completed build in 11m 32s on Wed, 4 Nov, 07:40 AM Test Summary: 73585 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7102

  3. Thomas Löffler commented on patch set 1 CR -1 11/04/20, 07:41

    Will add some tests for it.
  4. Thomas Löffler uploaded patch set 2 11/04/20, 08:04

  5. Thomas Löffler updated the commit message in patch set 3 11/04/20, 08:06

  6. TYPO3com voted on patch set 2 V +1 11/04/20, 08:15 Completed build in 11m 34s on Wed, 4 Nov, 08:15 AM Test Summary: 73609 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7103

  7. Thomas Löffler updated the commit message in patch set 4 11/04/20, 08:17

  8. TYPO3com voted on patch set 3 V +1 11/04/20, 08:20 Completed build in 14m 05s on Wed, 4 Nov, 08:20 AM Test Summary: 73609 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7104

  9. TYPO3com voted on patch set 4 V +1 11/04/20, 08:29 Completed build in 11m 55s on Wed, 4 Nov, 08:29 AM Test Summary: 73609 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7105

  10. Oli Bartsch commented on patch set 4 V -1 11/04/20, 09:15

    StandardPreviewRendererResolver.php:61

    $tcaTypeField is a string (The types field name) or null according to Line 47. Therefore this condition will now never match.
  11. Thomas Löffler commented on patch set 4 11/04/20, 09:29

    StandardPreviewRendererResolver.php:61 Reply

    You're right. Problem is that with the $typeConfiguration an array is used as $previewRendererClassName later. Then the the UnexpectedValueException is thrown as "Array" is no class name. How could we handle that?
  12. Oli Bartsch commented on patch set 4 11/04/20, 09:52

    StandardPreviewRendererResolver.php:61 Reply

    IMO the code works as described in https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/10.3/Feature-78450-IntroducePreviewRendererPattern.html#configuring-the-implementation According to this you have the possibility to define preview renderer which get evaluated in the following order: 1. ['types']['list']['previewRenderer'][$someSubtype] = Renderer::class 2. ['types']['list']['previewRenderer'] = Renderer::class 3. ['ctrl']['previewRenderer'] = Renderer::class If I understand you correct, the second case is not working because it's an array if already renderer for subtypes are defined. So would it be enough to just check $typeConfiguration['previewRenderer'] with `!is_array()` here? Otherwise we had to adjust the API for such scenarios like adding a 'default' case which is used if a subtype is selected but no specific previewRenderer is defined for it.
  13. Thomas Löffler commented on patch set 4 11/04/20, 10:18

    StandardPreviewRendererResolver.php:61 Reply

    Ack
  14. Thomas Löffler uploaded patch set 5 11/04/20, 10:50

  15. TYPO3com voted on patch set 5 V +1 11/04/20, 11:03 Completed build in 12m 26s on Wed, 4 Nov, 11:03 AM Test Summary: 73615 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7110

  16. Oli Bartsch uploaded patch set 6 01/11/21, 10:16

  17. Oli Bartsch voted on patch set 6 V +1 CR +1 01/11/21, 10:19

  18. TYPO3com voted on patch set 6 V +1 01/11/21, 10:27 Completed build in 10m 14s on Mon, 11 Jan, 10:27 AM Test Summary: 32579 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8804

  19. Benni Mack voted on patch set 6 V +2 CR +2 01/17/21, 11:22

  20. Benni Mack merged patch set 7 01/17/21, 11:22