[BUGFIX] Adding new records in edit mode broken 35/27935/5
authorAndre Hähnel <andre.haehnel@netresearch.de>
Fri, 28 Feb 2014 12:00:41 +0000 (13:00 +0100)
committerHelmut Hummel <helmut.hummel@typo3.org>
Fri, 28 Feb 2014 13:19:23 +0000 (14:19 +0100)
It was not possible anymore to use the "add new record" button
in TCA select fields on records with pid > 0.

This patch makes it work again; the redirect to the original page
gets prevented when a pid is set. This was handled the same way
in 4.6 and 6.1.

Change-Id: Iec058818405385efdacaebf5080f339371356810
Resolves: #56248
Related: #54085
Releases: 6.2
Reviewed-on: https://review.typo3.org/27935
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
typo3/sysext/backend/Classes/Controller/Wizard/AddController.php

index 5087504..3c8e7dc 100644 (file)
@@ -115,7 +115,7 @@ class AddController {
                        $this->pid = (int)$this->P['params']['pid'];
                }
                // Return if new record as parent (not possibly/allowed)
-               if ($this->pid > 0) {
+               if ($this->pid === '') {
                        HttpUtility::redirect(GeneralUtility::sanitizeLocalUrl($this->P['returnUrl']));
                }
                // Else proceed: