Review main Merged

88597[TASK] Improve PAGEVIEW error message for missing template files

Lina Wolf CR +2 V +2 Easy +39 −2 updated 03/24/25, 20:04

Commit message

The exception thrown by Fluid, in case a template is not found, looks
like this:

```
TYPO3Fluid\Fluid\View\Exception\InvalidTemplateResourceException:
Tried resolving a template file for controller action "Default->
Pages/Standard" in format ".html", but none of the paths contained
the expected template file (Default/Pages/Standard.html). The
following paths were checked:
.../typo3conf/ext/test_fluidpagerendering/Resources/Private/
Templates/WrongPath/
```

However, the integrator using the PAGEVIEW TypoScript object is not
using any controllers or actions. There is no information on where
the error happened or how to configure it.

This change improves the error message like this:

```
PAGEVIEW TypoScript object: Failed to resolve the expected template
file "Pages/Standard.html" for layout "Standard".
See also: https://docs.typo3.org/permalink/t3tsref:cobj-pageview@14.0.

The following paths were checked:
EXT:test_fluidpagerendering/Resources/Private/Templates/WrongPath/Pages/
Standard.html
```

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Garvin Hicking +1
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Benni Mack +2
    • Simon Schaufelberger +1
    • core-ci +1 CI

Issues 1

Files 3

Review log 1318

  1. Lina Wolf uploaded patch set 1 03/15/25, 17:59

  2. core-ci voted on patch set 1 V -1 03/15/25, 18:07 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75642

  3. Garvin Hicking updated the commit message in patch set 2 V -1 03/15/25, 20:37

  4. Garvin Hicking commented on patch set 2 03/15/25, 20:39

    PageViewContentObject.php:123

    We should probably unify creating the docs permalink. Maybe calling the VH to generate the URL is possible (or we might need a pre-parch introducing a service class for it). I can try to take a look.
  5. core-ci voted on patch set 2 V -1 03/15/25, 20:46 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75644

  6. Lina Wolf uploaded patch set 3 V -1 03/16/25, 09:31

  7. Lina Wolf commented on patch set 2 03/16/25, 09:32

    PageViewContentObject.php:123 Reply

    I think usages like this one are easy to find and fix once your established a better solution. Calling a viewhelper to create a link in an exceptions seems not very elegant to me? That is not what viewhelpers are for?
  8. core-ci voted on patch set 3 V +1 03/16/25, 09:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75659

  9. Garvin Hicking commented on patch set 3 03/17/25, 08:46

    PageViewContentObject.php:123 Reply

    I would like it like this: https://review.typo3.org/c/Packages/TYPO3.CMS/+/88611 [TASK] Use abstract docs.typo3.org linking service method ``` throw new InvalidTemplateResourceException( sprintf( 'PAGEVIEW TypoScript object: Failed to resolve the expected template file "%s" for layout "%s". See also: %s. The following paths were checked: %s', $templateFileName, $pageLayoutName, (new Typo3Information())->getDocsLink('t3tsref:cobj-pageview'), $checkedPaths, ), 1742058289, $e ); ``` What do you think?
  10. Lina Wolf commented on patch set 3 03/17/25, 08:50

    PageViewContentObject.php:123 Reply

    Looks good
  11. Garvin Hicking uploaded patch set 4 V +1 03/18/25, 08:03

    Adjust to new getDocsLink API
  12. Garvin Hicking uploaded patch set 5 03/18/25, 08:04

    Address CGL
  13. Garvin Hicking commented on patch set 5 CR +1 03/18/25, 08:04

    PageViewContentObject.php:123 Reply

    Done
  14. core-ci voted on patch set 4 V -1 03/18/25, 08:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75762

  15. core-ci voted on patch set 5 V +1 03/18/25, 08:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75763

  16. Simon Schaufelberger voted on patch set 5 CR +1 V +1 03/18/25, 08:52

  17. Benni Mack voted on patch set 5 CR +2 V +2 03/24/25, 20:04

  18. Benni Mack merged patch set 6 03/24/25, 20:04