Bug #51330

Update Exception with old property mapper

Added by Stefan Froemken about 8 years ago. Updated over 6 years ago.

Status:
Rejected
Priority:
Won't have this time
Assignee:
-
Category:
Extbase
Target version:
Start date:
2013-08-26
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.1
PHP Version:
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

Description

Hello Extbase-Team,

there is a problem with the old property mapper in newer TYPO3-Versions. Currently tested in 6.1 and current git version.
You can create a new record in FE, but you can't update the record:

#1249479819: The object of type "TYPO3\Oldmapper\Domain\Model\Person" given to update must be persisted already, but is new.

After debugging I found out that they have a different spl_hash. That's why this error message appears. They differ because of a different isDirty-Property.

Stefan


Files

oldmapper_0.0.0_201308260815.zip (990 KB) oldmapper_0.0.0_201308260815.zip Stefan Froemken, 2013-08-26 08:21
#1

Updated by Alexander Schnitzler about 8 years ago

Git bisect tells me the following:

8bd24e530deea26a7b1cb56018f88aa3a4c4ff9e is the first bad commit
commit 8bd24e530deea26a7b1cb56018f88aa3a4c4ff9e
Author: Thomas Maroschik <tmaroschik@dfau.de>
Date:   Mon Apr 15 17:48:35 2013 +0200

    [!!!][BUGFIX] Introduce explicit saving of modified domain objects

    In conjunction with the new property mapper the persistence layer
    saves modified domain objects that failed validation and/or mapping.

    This bugfix aligns the behavior of the persistence layer with Flow
    and introduces explicit saving of modified domain objects.

    Modified objects now need to be passed through their repository
    update method in order to be scheduled for saving by the persistence
    managers persistAll method.

    Fixes: #47251
    Releases: 6.1
    Change-Id: I2130f96d925d74942af70f92e38d2d0b2ea46f79
    Reviewed-on: https://review.typo3.org/19992
    Reviewed-by: Stefan Neufeind
    Tested-by: Stefan Neufeind
    Reviewed-by: Stefan Froemken
    Tested-by: Stefan Froemken
    Reviewed-by: Anja Leichsenring
    Tested-by: Anja Leichsenring
#2

Updated by Alexander Schnitzler about 8 years ago

btw: the core bisect result

b6c6a43597b1bd840d94a2faa7fae3d88064885f is the first bad commit
commit b6c6a43597b1bd840d94a2faa7fae3d88064885f
Author: TYPO3 Release Team <typo3v4@typo3.org>
Date:   Mon Apr 22 20:44:51 2013 +0200

    [TASK] Raise submodule pointer

    Change-Id: I0fda801a76949927e93197aac53d5d7a59d8bc34
    Reviewed-on: https://review.typo3.org/20084
    Reviewed-by: TYPO3 Release Team
    Tested-by: TYPO3 Release Team

git show:

commit b6c6a43597b1bd840d94a2faa7fae3d88064885f
Author: TYPO3 Release Team <typo3v4@typo3.org>
Date:   Mon Apr 22 20:44:51 2013 +0200

    [TASK] Raise submodule pointer

    Change-Id: I0fda801a76949927e93197aac53d5d7a59d8bc34
    Reviewed-on: https://review.typo3.org/20084
    Reviewed-by: TYPO3 Release Team
    Tested-by: TYPO3 Release Team

diff --git a/typo3/sysext/extbase b/typo3/sysext/extbase
index 856d701..8bd24e5 160000
--- a/typo3/sysext/extbase
+++ b/typo3/sysext/extbase
@@ -1 +1 @@
-Subproject commit 856d701a5a432f6779a23cf5322bc8ccd4812cc0
+Subproject commit 8bd24e530deea26a7b1cb56018f88aa3a4c4ff9e
#3

Updated by Alexander Schnitzler almost 8 years ago

  • Assignee deleted (Alexander Schnitzler)
#4

Updated by Tymoteusz Motylewski about 7 years ago

I had similar issue. The reason was that I was fetching the object from repository in the initialize action.
Later in the action I call repo->update() on the object provided by property mapper (action argument).
It worked fine in 4.7

#5

Updated by Lorenz Ulrich about 7 years ago

I have this problem after updating from 6.0 to 6.2, but even with @dontverifyrequesthash set.

#6

Updated by Alexander Opitz about 7 years ago

  • Project changed from 534 to TYPO3 Core
  • Category changed from Extbase: Property to Extbase
  • Target version changed from 6.2.0 to next-patchlevel
  • TYPO3 Version set to 6.1
  • Is Regression set to Yes
#7

Updated by Anja Leichsenring about 7 years ago

  • Status changed from New to Rejected
  • Priority changed from Should have to Won't have this time

old property mapper is not supported anymore and removed from the Core after 6.2. Use the new one instead.

#8

Updated by Michael Oehlhof over 6 years ago

For those who do not know how to fix it, I will show how I have fixed it.

Old code:
$persistenceManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Tx_Extbase_Persistence_Manager');

New code:
$objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Extbase\Object\ObjectManager');
$persistenceManager = $objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\PersistenceManager');


#9

Updated by Roman Eberle over 6 years ago

Thank you so much, Michael Oehlhof!!!

Also available in: Atom PDF