[BUGFIX] Fix multi edit link in TableListViewHelper 34/53534/2
authorGeorg Ringer <georg.ringer@gmail.com>
Fri, 14 Jul 2017 17:15:54 +0000 (19:15 +0200)
committerSusanne Moog <susanne.moog@typo3.org>
Mon, 17 Jul 2017 09:24:34 +0000 (11:24 +0200)
Load the proper requireJS module and provide the variable
T3_THIS_LOCATION to make the multi edit links working again.

Resolves: #81850
Releases: master, 8.7
Change-Id: I45af43359f4f9ee8fbd9da51a3a434c40dda9d4e
Reviewed-on: https://review.typo3.org/53534
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
typo3/sysext/fluid/Classes/ViewHelpers/Be/TableListViewHelper.php

index 1ad00dc..e213a58 100644 (file)
@@ -105,6 +105,8 @@ class TableListViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBacken
         $enableClickMenu = $this->arguments['enableClickMenu'];
         $clickTitleMode = $this->arguments['clickTitleMode'];
 
+        $this->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Recordlist/Recordlist');
+
         $pageinfo = BackendUtility::readPageAccess(GeneralUtility::_GP('id'), $GLOBALS['BE_USER']->getPagePermsClause(1));
         /** @var $dblist \TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList */
         $dblist = GeneralUtility::makeInstance(\TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList::class);
@@ -130,6 +132,10 @@ class TableListViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBacken
         $dblist->sortRev = $sortDescending;
         $dblist->script = $_SERVER['REQUEST_URI'];
         $dblist->generateList();
-        return $dblist->HTMLcode;
+
+        $js = 'var T3_THIS_LOCATION = ' . GeneralUtility::quoteJSvalue(rawurlencode(GeneralUtility::getIndpEnv('REQUEST_URI')));
+        $html = GeneralUtility::wrapJS($js) . $dblist->HTMLcode;
+
+        return $html;
     }
 }