[BUGFIX] Invalid relations of MM records in workspaces 24/28624/4
authorOliver Hader <oliver@typo3.org>
Fri, 21 Mar 2014 21:11:58 +0000 (22:11 +0100)
committerOliver Hader <oliver.hader@typo3.org>
Sat, 22 Mar 2014 00:59:38 +0000 (01:59 +0100)
commitd20ecc742c24430aa55657def6e8d9c87fe6b60e
tree0ae4ee89a88a95696aca9d75f84889a7cec8452a
parent740b4435b8b1888527eee3608257f7cdcdea4ce5
[BUGFIX] Invalid relations of MM records in workspaces

The basic problem with MM (ManyToMany) relations in workspaces is
that the intermediate table (MM table) does not have any
information about actually being a reference in a particular
workspace - there is no "t3ver_wsid" field. Thus, the meaning of
a relation needs to be determined from the entities on both sides
of the relation. The following is possible:

* both sides are live -> valid in live only
* exactly one side is versioned -> valid in a workspace only
* both sides are versioned -> valid in a workspace only

The difficulties now start with versioning one side first and
after some time the other side - thus the relation with exactly
one version and one live entity needs to be turned into an entry
pointing to both versions.

Resolves: #57169
Releases: 6.2
Change-Id: Idb043d520c30f15e85d54a016e52690f5f05cedc
Reviewed-on: https://review.typo3.org/28624
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
16 files changed:
typo3/sysext/core/Classes/DataHandling/DataHandler.php
typo3/sysext/core/Classes/Database/RelationHandler.php
typo3/sysext/core/Tests/Functional/DataHandling/Framework/ActionService.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/AbstractActionTestCase.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Modify/ActionTest.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Modify/DataSet/createCategoryNCreateRelation.csv
typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Modify/DataSet/createContentNCreateRelation.csv
typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Modify/DataSet/modifyBothsOfRelation.csv
typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Publish/ActionTest.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Publish/DataSet/createCategoryNCreateRelation.csv
typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Publish/DataSet/createContentNCreateRelation.csv
typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Publish/DataSet/modifyBothsOfRelation.csv
typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/PublishAll/ActionTest.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/PublishAll/DataSet/createCategoryNCreateRelation.csv
typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/PublishAll/DataSet/createContentNCreateRelation.csv
typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/PublishAll/DataSet/modifyBothsOfRelation.csv