Issue Task Closed

#56721ElementBrowser::getThisScript is not public

Philipp Wrann 03/10/14, 13:23 updated 10/23/17, 21:40

Description

In \TYPO3\CMS\Recordlist\Browser\ElementBrowser the method getThisScript is not public but you need it in your hooks fot the LinkBrowser (to generate a valid url). You can use the public property but as the core implementation is like:

$menuDef[‘page’][‘addParams’] = ‘onclick=“jumpToUrl(’ . GeneralUtility::quoteJSvalue($this->getThisScript() . ‘act=page’) . ‘);return false;”’;

It should be possible to use this method also from your hook

So please simple change accessibility for getThisScript to public.

Otherwise you have to do this in every single hook:
$script = strpos($this->parentObject->thisScript, ‘?’) === FALSE ? $this->parentObject->thisScript . ‘?’ : $this->parentObject->thisScript . ‘&’;
$menuDefinition[‘KEY’][‘addParams’] = ‘onclick=“jumpToUrl(’ . GeneralUtility::quoteJSvalue($script . ‘act=KEY’) . ‘);return false;”’;

Additionally i have to say:
The common way before to generate the tab link was
$menuDefinition[‘KEY’][‘addParams’] = ‘onclick=“jumpToUrl(\’‘ . htmlspecialchars((‘?act=KEY&mode=’ . $this->parentObject->mode . ‘&bparams=’ . $this->parentObject->bparams)) . ‘\’);return false;”’;

This is not compatible with TYPO3 6.2 anymore because of this new moduleToken, so it might be better to rethink that behaviour for the whole wizard. Otherwise many extension would be broken in that context.

Reviews 3