Project

General

Profile

Actions

Task #80381

closed

Show template/partial name when an exception occurs with Fluid

Added by Xavier Perseguers about 7 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Fluid
Target version:
-
Start date:
2017-03-21
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

I have following exception in frontend while upgrading a website initially done for TYPO3 v6 to v8:

Oops, an error occurred!
Undeclared arguments passed to ViewHelper FluidTYPO3\Vhs\ViewHelpers\IfViewHelper: then, else

Exception is thrown from \TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper::validateAdditionalArguments.

Here's the StackTrace:

It would be very useful to have additional information with the culprit template/partial file.

In this example this is not the actual name in the filesystem (which would be even better) but at least this parsed file with checksum gives a hint of where to look for the problem.


Files

TemplateParser.png (202 KB) TemplateParser.png Xavier Perseguers, 2017-03-21 16:52
Actions #1

Updated by Wouter Wolters about 7 years ago

  • Category set to Fluid
Actions #2

Updated by Benni Mack about 7 years ago

  • Status changed from New to Needs Feedback

Looks like it's an issue with EXT:vhs?

Actions #3

Updated by Xavier Perseguers about 7 years ago

There's indeed a problem related to the use of a VH from vhs but the stack trace shows that it goes a long way into fluid and the exception is thrown from fluid, not from vhs. As such this problem could happen with any extension so the exception thrown ultimately give more info, that is it should probably be catched "higher" and thrown again with more context.

Actions #4

Updated by Claus Due about 7 years ago

Fluid doesn't at this point know (or care) about the template path and filename. The exception that gets thrown should be a Parser scope exception which should contain additional information about the context (even includes the offending template code) - I guess we could fit this exception with a bit more context.

If you use debug mode you should see these additional aspects of the exception. I'm not sure the default error handler should show these things (I'd say no, it shouldn't)?

NB: I haven't checked recently but a while back this was true: setting application context in Install Tool is insufficient to cause a debug error handler to be used for content instances. For that, you have to set TYPO3_APPLICATION_CONTEXT in ENV/vhost.

Actions #5

Updated by Xavier Perseguers over 6 years ago

I was in dev context.

Actions #6

Updated by Alexander Opitz over 6 years ago

  • Status changed from Needs Feedback to New

Is the problem resolved Xavier?

Actions #7

Updated by Claus Due over 5 years ago

  • Status changed from New to Closed

I will close this issue since we cannot currently improve this situation in TYPO3 CMS. It might at some point be possible to give additional information with errors - but we would need that as a feature request for https://github.com/TYPO3/Fluid. The main challenge is that Fluid's parser only handles template sources and knows about the identifier - the actual filename only exists in a closure that gets passed to the template parser which then calls it to read the template source.

If this can be done, I suspect it might have to be through a coupling of TemplateParser and TemplatePaths - which may not be a good thing.

Actions

Also available in: Atom PDF