Bug #33416
closedException thrown by tslib_content->getContentObject when referenced TS objects are empty
0%
Description
In TypoScript setups you can use the following syntax:
page = PAGE page { 10 =< lib.myPageContent }
Now this is taken by tslib_content->cObjGetSingle and handed over to a recursive call to cObjGetSingle in line 755.
cObjGetSingle expects at least a name and a configuration as parameter, but none of them is getting any default value.
This works as long as the reference is pointing to an existing object:
lib.myPageContent = CONTENT lib.myPageContent { blah }
But if lib.myPageContent is empty, i.e. due to a condition that removes the object in a certain context, in the next step cObjGetSingle will still call tslib_content->getContentObject but with an empty name.
Since getContentObject won't find any class mapped to this empty name it will try to make an instance of a class 'tslib_content_' . $name - which will of cause lead to an exception.
Now we could call this a "feature" since this will show the users that there is something missing in their TypoScript setup, but IMHO the desired behaviour would be to either only call cObjGetSingle with existing names or use proper defaults for $name and $conf.
Opinions?
Updated by Ernesto Baschny almost 13 years ago
- Status changed from New to Accepted
Yes, a notice in TSlog (for admin panel) would be sufficient for debugging purposes. And then just return an empty string in these situations, right?
But not an exception, as this will probably break sites which had this situation before upgrading to 4.5.
Updated by Alexander Opitz almost 10 years ago
- Status changed from Accepted to Needs Feedback
- Target version deleted (
4.5.12) - Is Regression set to No
Hi,
does the problem still exists within newer versions of TYPO3 CMS (6.2.9)?
Updated by Jo Hasenau almost 10 years ago
Seems to have been accidentally fixed with the latest patch for #53682
Updated by Wouter Wolters almost 10 years ago
- Status changed from Needs Feedback to Closed