[TYPO3-core] RFC: Bug 5718: IRRE - Copying a page with related child records leads to duplicates of each children

Oliver Hader oh at inpublica.de
Tue Jun 12 10:40:54 CEST 2007


Hi Franz,

Franz Holzinger schrieb:
> Hello Oliver,
>>> copyRecord_procBasedOnFieldType($table,$uid,$field,$value,$row,$conf,$realDe
>>
>> This function wasn't changed in the patch sent for this RFC.
>>> I think this never will be reached when MM has been set, because it
>>> always goes to the first if.
>>
> // Avoid duplicates while copying (e.g. when IRRE children were already
> copied):
> +                        if
> (!isset($this->copyMappingArray[$table][$row['uid']])) {
> +                            $this->copyRecord($table,$row['uid'],
> $theNewRootID);    // Copying each of the underlying records...
> +                        }
> I think this if to avoid duplicate copies should be moved inside of the
> first if of the copyRecord function:
> In no circumstances a duplicate copy of the same will be needed. Or the
> contents of $this->copyMappingArray would be wrong.

I though about the same on writing the patch. But I also though that
some day it could be required to have kind of "drafts" for IRRE children
and thus copying child records more than once (e.g. done by any hook).

But I'm fine with moving the check against $this->copyMappingArray to
the function copyRecord(). I noticed that I forgot to do this also for
the raw copying in the function copyRecord_raw().


olly
-- 
Oliver Hader
http://inpublica.de/


More information about the TYPO3-team-core mailing list