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

Michael Stucki michael at typo3.org
Thu Jun 14 00:33:51 CEST 2007


Hi Oliver,

this doesn't work correct: The copied child records are not duplicated on
the orginal page anymore, and they are added as duplicates on the new page.

However, the child records are stored on the pid of that page once again.
The patch fixes the problem but raises a new one. -1 for now...

- michael

Oliver Hader wrote:

> Hi,
> 
> I attached a new patch. The check is moved to the functions copyRecord()
> and copyRecord_raw().
> 
> olly
> 
> 
> Oliver Hader schrieb:
>> 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

-- 
Use a newsreader! Check out
http://typo3.org/community/mailing-lists/use-a-news-reader/


More information about the TYPO3-team-core mailing list