Unset argument after evaluation

This commit is contained in:
Björn Fromme
2018-09-22 15:35:33 +02:00
parent d5f10df867
commit 28486cd292
@@ -58,17 +58,24 @@ class AjaxViewHelper extends ActionViewHelper
RenderingContextInterface $renderingContext
)
{
// Determine page type from format argument
if (strtolower(trim($arguments['format'])) === 'json') {
$arguments['pageType'] = self::PAGE_TYPE_JSON;
} else {
$arguments['pageType'] = self::PAGE_TYPE_HTML;
}
// Unset argument to keep it out of resulting url
$arguments['format'] = '';
// Use current page uid as target unless provided
if ($arguments['pageUid'] === null) {
$rootLine = $GLOBALS['TSFE']->sys_page->getRootLine($GLOBALS['TSFE']->id);
$rootPage = array_pop($rootLine);
$arguments['pageUid'] = $rootPage['uid'];
}
// Force absolute urls
$arguments['absolute'] = true;
return parent::renderStatic($arguments, $renderChildrenClosure, $renderingContext);