Bug #88036
closed
Adding a ce of type "plugin" without defining a plugin breaks FE
Added by Stephan Großberndt over 5 years ago.
Updated over 4 years ago.
Category:
Fluid Styled Content
Description
Create a content element of type "plugin" but do not define a plugin to use in list_type
.
This is valid when saving in backend currently and does not show up as a problem.
Up to TYPO3 8.7 this just leads to no output in the FE, in TYPO3 9.5.5 an exception is thrown:
(1/1) #1540246570 TYPO3Fluid\Fluid\Core\ViewHelper\Exception
No Content Object definition found at TypoScript object path "tt_content.list.20."
in /typo3_src-9.5.5/typo3/sysext/fluid/Classes/ViewHelpers/CObjectViewHelper.php line 132
- Category changed from Fluid to Fluid Styled Content
This looks like it is caused by changes to f:cObject which resolves the TS path segment by segment and throws a new type of error if not found, combined with the fact that this ViewHelper is called indiscriminately (no check for actually filled `list_type`) from the template that renders the output body.
Since we will not avoid throwing the exception (it was after all added intentionally as developer feedback help) the way to fix this is to avoid calling the ViewHelper in the template for those values that are predictably never going to work. Therefore I'm changing the category to Fluid Styled Content.
This issue can be returned to Fluid category if there is a wish/need for further validation and different exception messages if, for example, the received TS path ends with a dot. I personally think the message there is now, is helpful enough since it shows the entire path that was passed so you can quickly identify the cause is an empty value appended to the path when calling the ViewHelper.
- Related to Bug #86729: CObjectVIewHelper does not render top level object path added
- Status changed from New to Needs Feedback
Can you elaborate on the use case of defining a plugin, but not defining a rendering definition for it?
OK, got it. It is about an editor creating a plugin content element without selecting a plugin.
This case should imho be fixed with a validation in TCA, not allowing editors to create such elements.
Alternative would be indeed fixing FSC, as Claus suggested to restore the old behaviour, or to output an error message.
- Status changed from Needs Feedback to New
That would be an option too. It should just not throw an exception.
Imo backend is not an option as eg if once an editor creates a plugin and then the extension is removed, the exception will also be thrown
- Related to Feature #90567: Prevent saving of content element type "plugin" without Selected Plugin [list_type] added
- Status changed from New to Accepted
- Status changed from Accepted to Under Review
- Status changed from Under Review to Rejected
I am closing this issue as the exception is only shown if config.contentObjectExceptionHandler = 0
is used, otherwise just the one element is not shown which is fine. the issue is logged as well.
- Related to Bug #92413: Exception when no plugin is selected added
Also available in: Atom
PDF