[BUGFIX] New content elements are always stored on pid 0 89/30389/3
authorNicole Cordes <typo3@cordes.co>
Sun, 25 May 2014 17:30:54 +0000 (19:30 +0200)
committerMarkus Klein <klein.t3@mfc-linz.at>
Mon, 26 May 2014 09:58:13 +0000 (11:58 +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/30389
Reviewed-by: Fabien Udriot
Tested-by: Fabien Udriot
Reviewed-by: Alexander Opitz
Tested-by: Alexander Opitz
Reviewed-by: Markus Klein
Tested-by: Markus Klein
typo3/sysext/backend/Classes/Controller/ContentElement/NewContentElementController.php

index 671c3c3..46a2353 100644 (file)
@@ -123,7 +123,7 @@ class NewContentElementController {
                $this->id = (int)GeneralUtility::_GP('id');
                $this->sys_language = (int)GeneralUtility::_GP('sys_language_uid');
                $this->R_URI = GeneralUtility::sanitizeLocalUrl(GeneralUtility::_GP('returnUrl'));
-               $this->colPos = (int)GeneralUtility::_GP('colPos');
+               $this->colPos = GeneralUtility::_GP('colPos') === NULL ? NULL : (int)GeneralUtility::_GP('colPos');
                $this->uid_pid = (int)GeneralUtility::_GP('uid_pid');
                $this->MCONF['name'] = 'xMOD_db_new_content_el';
                $this->modTSconfig = BackendUtility::getModTSconfig($this->id, 'mod.wizards.newContentElement');
@@ -156,7 +156,7 @@ class NewContentElementController {
                        $posMap->cur_sys_language = $this->sys_language;
                        $posMap->backPath = $GLOBALS['BACK_PATH'];
                        // If a column is pre-set:
-                       if ((string) $this->colPos != '') {
+                       if (isset($this->colPos)) {
                                if ($this->uid_pid < 0) {
                                        $row = array();
                                        $row['uid'] = abs($this->uid_pid);