[TYPO3-core] RFC: #16601: tslib_menu and tslib_Xmenu calls stdwrap on $GLOBALS['TSFE']->cObj instead of this->parent_cObj
Ernesto Baschny [cron IT]
ernst at cron-it.de
Wed Dec 1 19:56:16 CET 2010
Steffen Kamper schrieb am 01.12.2010 14:56:
> This is an SVN patch request.
>
> Type: bug
>
> Bugtracker references:
> http://bugs.typo3.org/view.php?id=16601
>
> Branches:
> Trunk
>
> Situation:
> When having content elements of type "menu/sitemap" and using the
> subtype "Menu of these pages" then tslib_menu parses the values of
> config special.value with tslib_content.
>
> Problem:
> tslib_menu and tslib_Xmenu calls stdwrap on $GLOBALS['TSFE']->cObj
> instead of $this->parent_cObj which is not necessarily the same.
> tslib_content is not a singleton. $GLOBALS['TSFE']->cObj->data holds the
> data of the current page, whereas $this->parent_cObj->data holds the
> data of the calling content element or page
>
> Solution:
> Replace every occurence of $GLOBALS['TSFE']->cObj with $this->parent_cObj.
> Attached Patch fixes the Problem.
>
> Patch was provided by Thomas Maroschik
Only the two stdWrap calls was indeed wrongly changed in #16446 (rev.
9474 [1]). The calls to ->callUserFunction and ->exec_getQuery were
always referencing GLOBALS['TSFE'] so this change also adds a new
"feature" in that we support now the current ->data in these places as well.
(e.g. callUserFunction can now access the correct "parent" cObject,
which is passed on to the userFunction class as member variable
$this->cObj).
So I committed it to rev. 9733 after this review and some tests.
Cheers,
Ernesto
[1] http://bugs.typo3.org/view.php?id=16446
[2] http://forge.typo3.org/repositories/revision/typo3v4-core/9474
More information about the TYPO3-team-core
mailing list