Bug #56284
closedCopied references keep reference to original
0%
Description
When copying a record which holds sys_file_reference records the reference is copied with wrong relation data, so the original has 2 references but the copy none.
Updated by Thomas Hempel about 11 years ago
We can reproduce this behavior and it's still valid for 6.2beta6
As far as I can see, the relation to the sys_file_reference simply has the wrong uid_foreign after copy.
Updated by Thomas Hempel about 11 years ago
Alright, we tracked it down, and this is a serious issue as far as I can tell.
This is what we think right now:
When you copy a page, the core duplicates all records in order of their respective table in the TCA. The problem with this is, that tt_content is defined in "frontend" and sys_file_references are defined in the extension "core". By default core is loaded first, which means that tt_content records are copied AFTER all records defined in "frontend". The result is, that sys_file_references get copied but the relation can not be updated because the new tt_content record does not exist yet.
The problem can be solved by moving "frontend" before "core" in the packageStates.php. This is of course not a real solution but demonstrates the effect.
We could also observe another strange behavior. When you copy the original page again and paste it again, it will all file references but one. So if you start with
Page1 - tt_content:File1
-- first copy --
Page 1 - tt_content:File1, File1 (copy 1)
Page 1 (copy 1) - tt_content:
-- second copy of Page 1 --
Page 1 - tt_content:File1, File1 (copy 1), File1 (copy 2)
Page 1 (copy 1) - tt_content:
Page 1 (copy 2) - tt_content:File1
-- n copy of Page 1 --
Page 1 - tt_content:File1, File1 (copy 1), File1 (copy 2), File (copy 1), File (copy 2)
Page 1 (copy 1) - tt_content:
Page 1 (copy 2) - tt_content:File1
Page 1 (copy n) - tt_content:File1, File (copy 1), File (copy n)
This can be done indefinitely.
This is a major design flaw in the copy routine as it practically prevents related records to be copied with a page if they are not defined in ext:core.
Another small remark. This only occurs when copying the page. If you copy only the tt_content element, everything works fine.
Updated by Patrick Kollodzik about 11 years ago
The position of the $table inside the TCA is importent in the following code position:
In \TYPO3\CMS\Core\DataHandling\DataHandler, method copySpecificPage
The method iterates over all possible tables and tests if a record is on the page.
Because EXT:core is loaded before EXT:frontend the sys_file_refernce are copied before tt_content.
Updated by Martin Ficzel about 11 years ago
What can we do to help fixing this issue. It is really a huge problem for us since editors cannot copy pages with images at all at the moment.
Regards Martin
Updated by Alexander Stehlik about 11 years ago
Is this problem fixed with https://review.typo3.org/26552/ ?
Updated by Martin Ficzel about 11 years ago
Yes it seems https://review.typo3.org/26552/ fixes this aswell.
Updated by Ernesto Baschny about 11 years ago
- Status changed from Accepted to Needs Feedback
- Target version deleted (
next-patchlevel)
If this is fixed by the just merged #44795, we have this problem solved for 6.2.0 - great! :)
Confirmed? We could then close this issue.
Updated by Daniel Ostmann about 11 years ago
I can confirm this issue for 6.2.beta7.
The patch in https://review.typo3.org/#/c/26552/ solved it! Thank you :-)
Updated by Martin Ficzel about 11 years ago
For me this is solved after #44795. I cannot reproduce the Problem any more.
Updated by Ernesto Baschny about 11 years ago
- Status changed from Needs Feedback to Resolved
- Assignee deleted (
Nicole Cordes) - Target version set to 6.2.0
Great stuff, solved finally :)
Updated by Frank Gerards almost 10 years ago
Any updates on this ? Is this fixed in TYPO3 6.2.12 ???
Updated by Daniel Ostmann almost 10 years ago
Frank, please note the last update before yours. It is marked as solved :-)
Updated by Riccardo De Contardi over 7 years ago
- Status changed from Resolved to Closed