Bug #79294

Persisting Traversable DomainObjectInterface broken

Added by Mathias Brodala almost 3 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Must have
Category:
Extbase
Target version:
Start date:
2017-01-12
Due date:
% Done:

100%

TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Currently objects which implement the Traversable interface are always persisted as CSV of their values after iterating. This change introduced this change of behavior with TYPO3 7.0.0. This is broken in various ways:

  1. The type of the relation is ignored which could be e.g. ColumnMap::RELATION_HAS_ONE, thus multivalue does not make sense.
  2. If an object implements DomainObjectInterface it must always be persisted using its identifier.

While I'm not sure how to handle the first case the second one should be fixed right away since it breaks persistence of objects which implement both Traversable as well as DomainObjectInterface

test_traversable.zip - Test extension (6.24 KB) Mathias Brodala, 2017-01-23 10:15


Related issues

Related to TYPO3 Core - Task #57255: Cleanup redundant code in extbase persistence Closed 2014-03-24

Associated revisions

Revision 9378ce8b (diff)
Added by Mathias Brodala over 2 years ago

[BUGFIX] Persist traversable domain objects via identifier

Objects implementing the DomainObjectInterface must always be
persisted using their identifier, even if they implement the
Traversable interface.

Change-Id: Iccb53d6e7ded9b6b5300e111e8503641b10615f4
Resolves: #79294
Related: #57255
Releases: master, 7.6
Reviewed-on: https://review.typo3.org/51287
Tested-by: TYPO3com <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>

Revision 4d3ded20 (diff)
Added by Mathias Brodala over 2 years ago

[BUGFIX] Persist traversable domain objects via identifier

Objects implementing the DomainObjectInterface must always be
persisted using their identifier, even if they implement the
Traversable interface.

Change-Id: Iccb53d6e7ded9b6b5300e111e8503641b10615f4
Resolves: #79294
Related: #57255
Releases: master, 7.6
Reviewed-on: https://review.typo3.org/51446
Tested-by: TYPO3com <>
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>

History

#1 Updated by Gerrit Code Review almost 3 years ago

  • Status changed from In Progress 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 https://review.typo3.org/51287

#2 Updated by Gerrit Code Review almost 3 years ago

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

#3 Updated by Mathias Brodala over 2 years ago

Here's a test extension to demonstrate the issue. It contains a model Main and has one property pointing to a Related model which implements Traversable (through IteratorAggregate and a Generator).

When running the typo3/cli_dispatch.phpsh extbase test:persisttraversabledomainobject command, a row is added to each table, but the related field of tx_testtraversable_domain_model_main contains 0 instead of the UID of the newly inserted tx_testtraversable_domain_model_related row.

#4 Updated by Gerrit Code Review over 2 years ago

Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51446

#5 Updated by Mathias Brodala over 2 years ago

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

#6 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF