Bug #49804
closed
Wrong dam record references when copying records with DAM record references
Added by Christian Heindl over 11 years ago.
Updated about 6 years ago.
Category:
DataHandler aka TCEmain
Description
Scenario:
- 'tt_content' record with a field, which references DAM records/images ("txdam_getMediaTCA('image_field', 'field')"). uid:123
- 'pages' record also with a field, which references DAM records/images ("txdam_getMediaTCA('image_field', 'field')"). uid:123
Problem:
When you copy the tt_content record, the copy references not only the images which, where referenced by tt_content:123 but also the images referenced by pages:123.
It seems as the TYPO3 core API does not correctly query for the "tablenames" in the "tx_dam_mm_ref" table, when processing the field within t3lib/class.t3lib_loaddbgroup.php -> method "readMM" (line 260).
Steps to reproduce:
- Copy the tt_content:123 record to another page
Environment:
I can reproduce this on TYPO3 4.7.14.
I used dam_ttnews, created a news record with the same uid as a tt_content images element, ran
typo3conf/ext/dam_ttnews$ sed -i 's/tx_damnews_dam_images/tx_damttcontent_files/' *.php *.sql *.xml
added an image to the news record and copied it. News record has image from the news record and the tt_content record.
This is really a bug in TYPO3 core, class.t3lib_tcemain.php::copyRecord_procBasedOnFieldType()
.
It uses t3lib_loadDBGroup
, which does not include the table name in the SQL:
SELECT * FROM tx_dam_mm_ref
WHERE uid_foreign=275 AND ident='tx_damttcontent_files'
ORDER BY sorting_foreign
- Project changed from 128 to TYPO3 Core
Move to TYPO3 core bugtracker.
Problem is still present in current 6.2 release train.
- Category set to Database API (Doctrine DBAL)
- Status changed from New to Needs Feedback
- Assignee set to Christian Heindl
- TYPO3 Version set to 4.7
- Is Regression set to No
Hi Christian, as far as I know DAM is not compatible with 6.2... could you tell us how to reproduce the error in 6.2?
(I set for now version as 4.7)
Thank you!
As mentioned above, the problem is within the TYPO3 core database api. Therefore the problem still exists in 6.2 (although not with the dam extension, but other extensions may be affected by that problem). According to Christian Weiske the problem should now be located within the TYPO3\CMS\Core\DataHandling\DataHandler::copyRecord_procBasedOnFieldType() or TYPO3\CMS\Core\Database\RelationHandler class.
- Status changed from Needs Feedback to New
- Assignee deleted (
Christian Heindl)
- TYPO3 Version changed from 4.7 to 6.2
- Status changed from New to Accepted
- Category changed from Database API (Doctrine DBAL) to DataHandler aka TCEmain
- Status changed from Accepted to Needs Feedback
Can somebody provide steps to reproduce with any supported TYPO3 version?
I can help in fixing whathever it is, but need to be able to reproduce first.
In case of lack of feedback the issue will be closed.
- Status changed from Needs Feedback to Closed
No feedback since the last 90 days => closing this issue.
If you think that this is the wrong decision or experience the issue again and have more information about how to reproduce your problem on recent TYPO3 versions like 8.7.x or 9.5.x, please reopen it or open a new issue with a reference to this one.
Thank you and best regards
Also available in: Atom
PDF