[BUGFIX] Redirect to record after creating new root template 91/35791/3
authorGeorg Ringer <georg.ringer@gmail.com>
Mon, 5 Jan 2015 15:58:22 +0000 (16:58 +0100)
committerMarkus Klein <klein.t3@reelworx.at>
Mon, 5 Jan 2015 20:28:56 +0000 (21:28 +0100)
After clicking the button "Create template for a new site", the
user is redirected to the new template record.

Resolves: #62195
Releases: master, 6.2
Change-Id: I8d999760f09f5e81a5286a9a3790f6292bf3eb39
Reviewed-on: http://review.typo3.org/35791
Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Reviewed-by: Stefan Froemken <froemken@gmail.com>
Tested-by: Stefan Froemken <froemken@gmail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateModuleController.php

index ae5fcf8..1fdfe85 100644 (file)
@@ -412,23 +412,19 @@ class TypoScriptTemplateModuleController extends \TYPO3\CMS\Backend\Module\BaseS
         * @return string
         */
        public function createTemplate($id, $actTemplateId = 0) {
+               $recData = array();
+               /** @var $tce \TYPO3\CMS\Core\DataHandling\DataHandler */
+               $tce = GeneralUtility::makeInstance(\TYPO3\CMS\Core\DataHandling\DataHandler::class);
+               $tce->stripslashes_values = 0;
+
                if (GeneralUtility::_GP('createExtension') || GeneralUtility::_GP('createExtension_x')) {
-                       $tce = GeneralUtility::makeInstance(\TYPO3\CMS\Core\DataHandling\DataHandler::class);
-                       /** @var $tce \TYPO3\CMS\Core\DataHandling\DataHandler */
-                       $tce->stripslashes_values = 0;
-                       $recData = array();
                        $recData['sys_template']['NEW'] = array(
                                'pid' => $actTemplateId ? -1 * $actTemplateId : $id,
                                'title' => '+ext'
                        );
                        $tce->start($recData, array());
                        $tce->process_datamap();
-                       return $tce->substNEWwithIDs['NEW'];
                } elseif (GeneralUtility::_GP('newWebsite')) {
-                       $tce = GeneralUtility::makeInstance(\TYPO3\CMS\Core\DataHandling\DataHandler::class);
-                       /** @var $tce \TYPO3\CMS\Core\DataHandling\DataHandler */
-                       $tce->stripslashes_values = 0;
-                       $recData = array();
                        // Hook to handle row data, implemented for statictemplates
                        if (isset(
                                $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][\TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::class]['newStandardTemplateHandler']
@@ -462,6 +458,7 @@ page.10.value = HELLO WORLD!
                        $tce->process_datamap();
                        $tce->clear_cacheCmd('all');
                }
+               return $tce->substNEWwithIDs['NEW'];
        }
 
        // RENDER LIST of pages with templates, BEGIN