Bug #60544

Pid property not set after insert

Added by Mathias Brodala over 5 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2014-07-24
Due date:
% Done:

100%

TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

Description

After adding and persisting a new object, its uid property is set pointing to the newly created database entry.

However, the pid property should be set likewise so that the caller can get to know where the object ended up being stored.

Without this, one has to basically reproduce the determineStoragePageIdForNewRecord method to find out what PID the backend used in the end.


Related issues

Related to TYPO3 Core - Bug #65364: _languageUid gets overwritten on updating a new domain object. Closed 2015-02-26

Associated revisions

Revision e75747bb (diff)
Added by Mathias Brodala almost 5 years ago

[BUGFIX] Pid property not set after insert

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 <>
Reviewed-by: Oliver Klee <>
Reviewed-by: Benjamin Mack <>
Reviewed-by: Steffen Müller <>
Tested-by: Steffen Müller <>
Reviewed-by: Anja Leichsenring <>
Tested-by: Anja Leichsenring <>

Revision 772102dd (diff)
Added by Mathias Brodala almost 5 years ago

[BUGFIX] Pid property not set after insert

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/36423
Reviewed-by: Anja Leichsenring <>
Tested-by: Anja Leichsenring <>

History

#1 Updated by Gerrit Code Review almost 5 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35474

#2 Updated by Anja Leichsenring almost 5 years ago

You can do a
$repo->add(object) what initiates the insert. Then $persistenceManager->persistAll() launches the real insert (or any other databased/persistence related) action. After this, $object->getPid() contains the pid. You have to ask the repo anyway, when you want to do more stuff with the object after insertion, so this will not help you.

#3 Updated by Alexander Opitz almost 5 years ago

  • Status changed from Under Review to Rejected
  • Target version deleted (next-patchlevel)

As explained by Anja Leichsenring, I close this one as rejected.

If you need more help on this please ask on Forum/Mailinglist.

#4 Updated by Mathias Brodala almost 5 years ago

Please leave me some time to verify this.

#5 Updated by Mathias Brodala almost 5 years ago

Please reopen this, the steps mentioned by Anja do not work.

#6 Updated by Gerrit Code Review almost 5 years ago

  • Status changed from Rejected to Under Review

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35474

#7 Updated by Gerrit Code Review almost 5 years ago

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36423

#8 Updated by Anja Leichsenring almost 5 years ago

  • Sprint Focus set to On Location Sprint

#9 Updated by Mathias Brodala almost 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#10 Updated by Anja Leichsenring almost 4 years ago

  • Sprint Focus deleted (On Location Sprint)

#11 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF