Review main Merged

63438[BUGFIX] Automatically use JsonView for json format

Alexander Schnitzler CR +2 V +2 Normal +156 −4 updated 03/30/20, 14:36

Commit message

With https://review.typo3.org/c/Packages/TYPO3.CMS/+/59514/ all
possibilities have been taken to define which view class to use
based on the format query param. As those format query params
are still api and in use, the core must reintegrate the former
behaviour: Instantiating a JsonView object for requests with a
format query param set to 'json'.

The implementation is marked as internal as the overall idea
is to remove the format param in the long run.

Review

  • Code review CR +2 Done
    • Susi Moog +2
    • Georg Ringer +1
    • Benni Mack +1
  • Verified V +2 Done
    • Susi Moog +2
    • Benni Mack +1
    • TYPO3com +1 CI

Issues 1

Files 6

Review log 1522

  1. Alexander Schnitzler uploaded patch set 1 02/26/20, 09:32

  2. TYPO3com voted on patch set 1 V +1 02/26/20, 09:46 Completed build in 13m 17s on Wed, 26 Feb, 09:46 AM Test Summary: 71997 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-713

  3. TYPO3com voted on patch set 1 V -1 02/27/20, 21:11 Completed build in 10m 38s on Thu, 27 Feb, 09:11 PM Test Summary: 61770 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-758

  4. TYPO3com voted on patch set 1 V +1 02/27/20, 21:16 Completed build in 25m 51s on Thu, 27 Feb, 09:15 PM Test Summary: 72003 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-758

  5. Alexander Schnitzler rebased onto patch set 2 03/19/20, 16:57

  6. Alexander Schnitzler wrote 03/19/20, 16:57

    Topic set to extbase
  7. TYPO3com voted on patch set 2 V -1 03/19/20, 17:09 Completed build in 12m 29s on Thu, 19 Mar, 05:09 PM Test Summary: 72095 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1463

  8. Alexander Schnitzler uploaded patch set 3 03/19/20, 17:38

  9. TYPO3com voted on patch set 2 V +1 03/19/20, 17:43 Completed build in 58m 46s on Thu, 19 Mar, 05:43 PM Test Summary: 72114 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1463

  10. TYPO3com voted on patch set 3 V +1 03/19/20, 17:50 Completed build in 11m 39s on Thu, 19 Mar, 05:50 PM Test Summary: 72120 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1466

  11. Alexander Schnitzler voted on patch set 3 V +1 CR +1 03/19/20, 17:58

  12. Georg Ringer commented on patch set 3 CR -1 03/19/20, 18:11

    GenericViewResolver.php:2 Unresolved

    header comment missing

    GenericViewResolver.php:39

    so why not using $viewClass = $format === 'json' ? JsonViewClass : $this->defaultViewClass?

    TestController.php:73 Unresolved

    maybe more speaking names?
  13. Alexander Schnitzler commented on patch set 3 03/19/20, 18:17

    GenericViewResolver.php:39 Reply Unresolved

    You are right, it's much easier.
  14. Alexander Schnitzler uploaded patch set 4 03/19/20, 18:33

  15. TYPO3com voted on patch set 4 V +1 03/19/20, 18:47 Completed build in 13m 46s on Thu, 19 Mar, 06:47 PM Test Summary: 72120 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1470

  16. Georg Ringer voted on patch set 4 CR +1 03/19/20, 20:39

  17. Benni Mack voted on patch set 4 V +1 CR +1 03/20/20, 19:29

  18. Susi Moog voted on patch set 4 V +2 CR +2 03/21/20, 08:36

  19. Susi Moog merged patch set 5 03/21/20, 08:36

  20. Andreas Kienast commented on patch set 5 03/28/20, 21:08

    Post -1 The extension manager now cannot resolve dependencies anymore. DownloadController::installFromTerAction() is entered, but the response is "null" as "variablesToRender" is an empty array.
  21. Daniel Goerz commented on patch set 5 03/29/20, 12:52

    post -1, this looks like a breaking change. All actions that expect a TemplateView despite the format being 'json' will now receive the wrong (or from another point of view: the correct) view object. This even breaks in core itself in the EM as Andi mentioned. The DownloadController overwrites the defaultViewObjectName in initializeInstallFromTerAction() which lead to a TemplateView object prior to this patch. Now the action receives a JsonView because the request requested 'json' as a format. This should obviously be fixed so that HTML is requested in that AJAX call, but I still think this might break more extensions out there and should not be included in the LTS release.
  22. Alexander Schnitzler wrote 03/30/20, 14:36

    Created a revert of this change as Id224ad901d1e415687c8cd2207d516b19a09fd99