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?