Review main Merged

70762[TASK] Obsolete NotFoundView and deprecate canRender()

Christian Kuhn CR +2 V +2 Hard +59 −208 updated 08/26/21, 16:28

Commit message

Extbase ActionController has a view functionality to
test if the target template files exist and to render
an error message via NotFoundView if not.

This is the only use of @internal marked NotFoundView
and the only practical usage of extbase ViewInterface
canRender().

This structure can be simplified significantly, without
loosing functionality. The patch:

* Removes @internal NotFoundView and its template
* Drops canRender() from ViewInterface
* Keeps canRender() in extbase ViewInterface implementations
  but marks them @deprecated and logs usages.
* Changes extbase ActionController to not test canRender()
  but to let InvalidTemplateResourceException bubble up
  during $view->render().

This handling as a result - in case of missing templates -
provides a full backtrace with a better error message than
before, that of course still includes the controller and action
name, plus the template location that has not been found.

In the frontend, the exception is handled by the casual
"plugin based exception handling"
(TypoScript config.contentObjectExceptionHandler), a
"template missing" programming error is now handled
just like any other plugin exception.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Oli Bartsch +1
    • Jochen Roth +1
    • Wouter Wolters +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Oli Bartsch +1
    • Jochen Roth +1
    • Wouter Wolters +1
    • core-ci +1 CI

Issues 1

Files 12

Review log 913

  1. Christian Kuhn uploaded patch set 1 08/26/21, 07:56

  2. core-ci voted on patch set 1 V -1 08/26/21, 07:59 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15649

  3. Christian Kuhn uploaded patch set 2 08/26/21, 08:27

  4. core-ci voted on patch set 2 V -1 08/26/21, 08:50 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15654

  5. core-ci voted on patch set 2 V +1 08/26/21, 09:03 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15654

  6. Christian Kuhn uploaded patch set 3 08/26/21, 11:29

  7. core-ci voted on patch set 3 V +1 08/26/21, 11:52 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15665

  8. Jochen Roth voted on patch set 3 V +1 CR +1 08/26/21, 12:33

  9. Wouter Wolters voted on patch set 3 V +1 CR +1 08/26/21, 13:02

  10. Oli Bartsch commented on patch set 3 08/26/21, 15:42

    With this patch applied and having `config.contentObjectExceptionHandler = 1` set (which is the default on production context), following message is rendered in frontend: > Oops, an error occurred! Code: {code}
  11. Oli Bartsch commented on patch set 3 V +1 CR +1 08/26/21, 16:26

  12. Christian Kuhn voted on patch set 3 V +2 CR +2 08/26/21, 16:28

  13. Christian Kuhn merged patch set 4 08/26/21, 16:28