Bug #4317

Still Problems with SplObjectStorage duplicates

Added by Tommy Seus almost 6 years ago. Updated about 4 years ago.

Status:Resolved Start date:2009-08-25
Priority:Should have Due date:
Assigned To:Karsten Dambekalns % Done:

100%

Category:FLOW3 Persistence
Target version:-

Description

My Version is Revision r3094

There are still problems with the SplObjectStorage duplicates (Issue #3819).

I have attached my script. In addition, the blog model must be expanded.

Step1:
creating a Blog
creating a Post1
creating a Post2
add Post1 to Blog

Step2:
add Post2 to Blog

Step3
detach Post1 from Blog

TestController.php Magnifier - testController (3.2 kB) Tommy Seus, 2009-08-25 16:17

Blog.php Magnifier - modified Blog Modell (detachPost) (4.1 kB) Tommy Seus, 2009-08-25 16:17

blogs.jpg - TYPO3CR (17.8 kB) Tommy Seus, 2009-08-25 16:17

revision.jpg (4.2 kB) Tommy Seus, 2009-08-25 16:17

Backend.php Magnifier - modified F3\TYPO3CR\FLOW3\Persistence\Backend (3.2 kB) Tommy Seus, 2009-09-08 01:42

Associated revisions

Revision 86971cd1
Added by Karsten Dambekalns almost 6 years ago

[+BUGFIX] TYPO3CR (FLOW3 Persistence): fixes to storing arrays and SplObjectStorage properties, fixes #4317.
[~TASK] TYPO3CR (FLOW3 Persistence): some tweaks to DataMapper and storage search classes.

History

#1 Updated by Tommy Seus almost 6 years ago

Hello, I tried to find a solution. In the initial state will always generate a ItemNode without checking to see if it already exists. My modification performs this check and this triggers the problem of duplicate entries when adding (ATTACH).

Removing (DETACH) of objects is more complicated. Here are 2 lists "compared". Once the new list, ahead of objects are removed. In the second list, the database objects are stored. If in the first list an item missing, this will be deleted from the second.

I hope this solution inspires you.

#2 Updated by Karsten Dambekalns almost 6 years ago

  • Category set to FLOW3 Persistence
  • Status changed from New to Accepted
  • Assigned To set to Karsten Dambekalns

#3 Updated by Karsten Dambekalns almost 6 years ago

  • Status changed from Accepted to Resolved
  • % Done changed from 0 to 100

Applied in changeset r3328.

Also available in: Atom PDF