[BUGFIX] PageTS newRecord wizard options are unset by default
authorChristopher Stelmaszyk <Christopher.Stelmaszyk@gmx.de>
Thu, 20 Oct 2011 12:16:17 +0000 (14:16 +0200)
committerSteffen Gebert <steffen.gebert@typo3.org>
Fri, 21 Oct 2011 11:32:56 +0000 (13:32 +0200)
The following PageTS options are unset by default:
* mod.wizards.newRecord.pages.show.pageInside
* mod.wizards.newRecord.pages.show.pageAfter
* mod.wizards.newRecord.pages.show.pageSelectPosition

However, PHP codes treats these unset values (empty string) as being
enabled, which can lead to confusions.

Set the default value to 1.

Change-Id: I272155a8fe0c4f09ef14a7723f3cad23fc527197
Related: #24616
Resolves: #31132
Releases: 4.6
Reviewed-on: http://review.typo3.org/6128
Reviewed-by: Markus Klein
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
Reviewed-by: Francois Suter
Reviewed-by: Steffen Gebert
Tested-by: Steffen Gebert
t3lib/config_default.php
typo3/db_new.php

index 0add931..3722efc 100644 (file)
@@ -458,7 +458,11 @@ $TYPO3_CONF_VARS = array(
                ',      // String (exclude). Enter lines of default backend user/group TSconfig.
                'defaultPageTSconfig' => 'mod.web_list.enableDisplayBigControlPanel=selectable
                        mod.web_list.enableClipBoard=selectable
-                       mod.web_list.enableLocalizationView=selectable',                        // String (exclude).Enter lines of default Page TSconfig.
+                       mod.web_list.enableLocalizationView=selectable
+                       mod.wizards.newRecord.pages.show.pageInside=1
+                       mod.wizards.newRecord.pages.show.pageAfter=1
+                       mod.wizards.newRecord.pages.show.pageSelectPosition=1
+               ',      // String (exclude).Enter lines of default Page TSconfig.
                'defaultPermissions' => array (                 // Default permissions set for new pages in t3lib/tce_main.php. Keys are 'show,edit,delete,new,editcontent'. Enter as comma-list
 //                     'user' => '',                                           // default in tce_main is 'show,edit,delete,new,editcontent'. If this is set (uncomment), this value is used instead.
 //                     'group' => '',                                          // default in tce_main is 'show,edit,new,editcontent'. If this is set (uncomment), this value is used instead.
index ef4f72b..399b276 100644 (file)
@@ -96,7 +96,13 @@ class SC_db_new {
        var $newPagesInto;
        var $newContentInto;
        var $newPagesAfter;
-       protected $newPagesSelectPosition = 1;
+
+       /**
+        * Determines, whether "Select Position" for new page should be shown
+        * @var bool $newPagesSelectPosition
+        */
+       protected $newPagesSelectPosition = TRUE;
+
        var $web_list_modTSconfig;
        var $allowedNewTables;
        var $deniedNewTables;
@@ -351,15 +357,13 @@ class SC_db_new {
                $pageTS = t3lib_BEfunc::getPagesTSconfig($this->id);
                        // Finish initializing new pages options with TSconfig
                        // Each new page option may be hidden by TSconfig
-               if (isset($pageTS['mod.']['wizards.']['newRecord.']['pages.']['show.']['pageInside']) && $pageTS['mod.']['wizards.']['newRecord.']['pages.']['show.']['pageInside'] === '0') {
-                       $this->newPagesInto = 0;
-               }
-               if (isset($pageTS['mod.']['wizards.']['newRecord.']['pages.']['show.']['pageAfter']) && $pageTS['mod.']['wizards.']['newRecord.']['pages.']['show.']['pageAfter'] === '0') {
-                       $this->newPagesAfter = 0;
-               }
-               if (isset($pageTS['mod.']['wizards.']['newRecord.']['pages.']['show.']['pageSelectPosition']) && $pageTS['mod.']['wizards.']['newRecord.']['pages.']['show.']['pageSelectPosition'] === '0') {
-                       $this->newPagesSelectPosition = 0;
-               }
+
+                       // Enabled option for the position of a new page
+               $this->newPagesSelectPosition = !empty($pageTS['mod.']['wizards.']['newRecord.']['pages.']['show.']['pageSelectPosition']);
+                       // pseudo-boolean (0/1) for backward compatibility
+               $this->newPagesInto = (!empty($pageTS['mod.']['wizards.']['newRecord.']['pages.']['show.']['pageInside']) ? 1 : 0);
+               $this->newPagesAfter = (!empty($pageTS['mod.']['wizards.']['newRecord.']['pages.']['show.']['pageAfter']) ? 1 : 0);
+
 
                        // Slight spacer from header:
                $this->code .= $halfLine;