Issue Bug Closed

#100924DataHandler->copyRecord with an CE that uses inline-Relation and sys_file_reference

Ralph Brugger 05/26/23, 13:22 updated 10/03/26, 04:38

Description

DataHandler->copyRecord with an CE that uses inline-Relation and sys_file_reference

We’re using an self written extension called RSM-FAQ.
The Extension has an CType plugin rsmfaq_pi1.

The plugin has a inline-relation to a table called tx_rsmfaq_item.

The TCA of the tx_rsmfaq_item defines a field media which adds images to the tx_rsmfaq_item.

This Extension is originally years old and currently runs with TYPO3 11.5.

Situation:
When we copy the CE in the backend everything works fine.

Problem:
We’re using a hook in which one rsmfaq_pi1-CE is copied to another (empty) page:

$DataHandler->copyRecord('tt_content', 145733, 23143, false); // FAQ

The CE and the tx_rsmfaq_items are copied correctly.
BUT: The images of the tx_rsmfaq_item will be copied and assigned to the source item, but not the target (copy).

After copying the rsmfaq_pi1-CE, the target CE has the tx_rsmfaq_items but the images are not copied to the target page and not assigned to the target-rsmfaq_pi1-CE.
The images will be copied to the source page and assigned to the source-rsmfaq_pi1-CE.

Is this a problem of the TCA?
Is this a bug?

We’re using the same approach in serveral extensions, and the problem is the same.

I’ll attach:
ext_tables.sql
Configuration/TCA/tx_rsmfaq_item.php
Configuration/TCA/Overrides/tt_content.php

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

Files 3

History 2

  1. Georg Ringer commented and changed status New Closed <span data-processor="relativetime" data-value="2026-10-03T04:38:35+00:00" > 10/03/26, 04:38 </span>

    Hey,

    thanks for your issue. closing it as it rather old and probably because of wrong usage of API.

    proper way would be

      $dataHandler->start([], ['tt_content' => [145733 => ['copy' => 23143]]]);                                                                                                     
      $dataHandler->process_cmdmap();  

    The correction of IDs happens at a very last point in remapListedDBRecords() and processRemapStack() and using a custom copyRecord in the middle of copying prohibits that.