Project

General

Profile

Actions

Bug #33416

closed

Exception thrown by tslib_content->getContentObject when referenced TS objects are empty

Added by Jo Hasenau over 12 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
TypoScript
Target version:
-
Start date:
2012-01-24
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
5.3
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

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?


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #53682: Exception '$toolbarItem "shortcuts" must implement interface ...\ToolbarItemHookInterface'Closed2013-11-15

Actions
Actions

Also available in: Atom PDF