[BUGFIX] Redirect to record after creating new root template 03/35803/2
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:34:29 +0000 (21:34 +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/35803
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateModuleController.php

index 32df527..1da3c47 100644 (file)
@@ -398,23 +398,19 @@ class TypoScriptTemplateModuleController extends \TYPO3\CMS\Backend\Module\BaseS
         * @todo Define visibility
         */
        public function createTemplate($id, $actTemplateId = 0) {
+               $recData = array();
+               /** @var $tce \TYPO3\CMS\Core\DataHandling\DataHandler */
+               $tce = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\DataHandling\\DataHandler');
+               $tce->stripslashes_values = FALSE;
+
                if (GeneralUtility::_GP('createExtension') || GeneralUtility::_GP('createExtension_x')) {
-                       $tce = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\DataHandling\\DataHandler');
-                       /** @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');
-                       /** @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']['newStandardTemplateHandler']
@@ -448,6 +444,7 @@ page.10.value = HELLO WORLD!
                        $tce->process_datamap();
                        $tce->clear_cacheCmd('all');
                }
+               return $tce->substNEWwithIDs['NEW'];
        }
 
        // RENDER LIST of pages with templates, BEGIN