[BUGFIX] Pid property not set after insert 74/35474/3
authorMathias Brodala <mbrodala@pagemachine.de>
Mon, 15 Dec 2014 11:13:25 +0000 (12:13 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Fri, 30 Jan 2015 13:25:52 +0000 (14:25 +0100)
After adding and persisting a new object, its uid property is set,
the same should happen for its pid property. This way the caller
can get to know where the object ended up being stored.

Resolves: #60544
Releases: master, 6.2
Change-Id: Ibd11918c06b52deac69a8c3b83c454e3f24462a8
Reviewed-on: http://review.typo3.org/35474
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Benjamin Mack <benni@typo3.org>
Reviewed-by: Steffen Müller <typo3@t3node.com>
Tested-by: Steffen Müller <typo3@t3node.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php

index 0249874..5eaa184 100644 (file)
@@ -631,6 +631,7 @@ class Backend implements \TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface
                }
                $uid = $this->storageBackend->addRow($dataMap->getTableName(), $row);
                $object->_setProperty('uid', (int)$uid);
+               $object->setPid((int)$row['pid']);
                if ((int)$uid >= 1) {
                        $this->emitAfterInsertObjectSignal($object);
                }