[BUGFIX] New content elements are always stored on pid 0 19/30419/2
authorMarkus Klein <klein.t3@mfc-linz.at>
Mon, 26 May 2014 16:00:45 +0000 (18:00 +0200)
committerMarkus Klein <klein.t3@mfc-linz.at>
Thu, 5 Jun 2014 06:41:55 +0000 (08:41 +0200)
Due to patch https://review.typo3.org/#/c/30305/ the string comparison
on colPos fails and new content elements are always stored on pid 0.
This patch corrects the check for an integer colPos type by setting the
unused variable to NULL.

Resolves: #59059
Releases: 6.2, 6.1, 6.0, 4.7, 4.5
Change-Id: Iecd7f0cacf5c9315d882eebeb3893bcfa63ae7eb
Reviewed-on: https://review.typo3.org/30419
Tested-by: SITS Developer
Reviewed-by: Markus Klein
Tested-by: Markus Klein
typo3/sysext/cms/layout/db_new_content_el.php

index 75fe910..7d8e063 100644 (file)
@@ -186,7 +186,7 @@ class SC_db_new_content_el {
                $this->id = intval(t3lib_div::_GP('id'));
                $this->sys_language = intval(t3lib_div::_GP('sys_language_uid'));
                $this->R_URI = t3lib_div::sanitizeLocalUrl(t3lib_div::_GP('returnUrl'));
-               $this->colPos = (int)t3lib_div::_GP('colPos');
+               $this->colPos = t3lib_div::_GP('colPos') === NULL ? NULL : (int)t3lib_div::_GP('colPos');
                $this->uid_pid = intval(t3lib_div::_GP('uid_pid'));
 
                $this->MCONF['name'] = 'xMOD_db_new_content_el';
@@ -227,7 +227,7 @@ class SC_db_new_content_el {
                        $posMap->cur_sys_language = $this->sys_language;
                        $posMap->backPath = $BACK_PATH;
 
-                       if ((string)$this->colPos!='')  {       // If a column is pre-set:
+                       if (isset($this->colPos))       {       // If a column is pre-set:
                                if ($this->uid_pid<0)   {
                                        $row=array();
                                        $row['uid']=abs($this->uid_pid);