The term "references" relates in this case to IRRE children as
well as to MM records (without using IRRE at all).
The term "copying" on workspaces expands to the topics of
localization, discarding elements and the actual duplication.
* Localization of IRRE parent records and related children
Localization works like copying internally and thus at the
end gets back to the copy logic.
* Discarding elements on workspaces
That's the most funny thing that, since discarding/deleting
elements is basically the same as creating a copy, but with
accordant data to set deleted flags (for delete placeholder).
All actions that are related to that need to use
versionizeRecord() for dependent children.
* Copying IRRE parent records and related children
The copy logic tries to determine whether a "copy action" is
a localization, discarding or real duplication of an accordant
parent element. Currently versionizeRecord() is used which
just creates a new version, but without using a placeholder.
Thus, there is no indication that it's a new record and not
related to to any existing record. This means, that
versionizeRecord() only shall be used if this was the initial
command as well (the indication is done by using the
$workspaceOptions array).
* Resolving concrete version record instead of placeholder
In case the parent record was copied on a workspace, then this
results in a new-placeholder which is overlaid by the concrete
version in the workspace. In any kind children need to point
to the concrete version instead of the placeholder record.
This change includes the following flaws:
* to use the correct method, depending on the action (see above)
* to determin workspace action by BE_USER->workspace instead of
using $realDestPid == -1, which might get resolved and thus
would be positiv and no workspace indication anymore
* ensure to forward accordant data to children's placeholder
* use the specific workspace version (if any) on copying,
otherwise the placeholder records would be used, resulting in
losing references of any type (MM and IRRE)
If additional data needs to be set on placeholders as well,
use the correct 'shadowColumnsForNewPlaceholders' in TCA, e.g.
$TCA[<table>]['ctrl']['shadowColumnsForNewPlaceholders'] = ...