Issue Bug Closed

#16166Publishing a record breaks dam_ttcontent-relations

Andreas Wolf 05/22/06, 13:54 updated 12/10/13, 01:14

Description

When you publish an updated version of a record, changes in the DAM-Items-Field (tx_damttcontent_files) are not shown in the FE. You always get the images you inserted into the first version of the record. This happens because the field uid_foreign in tx_dam_mm_ref is not updated when the id of the two content-elements (the old “live”- and the new “draft”-element) is switched.

Create a new content-element in a draft-workspace, insert DAM-items (with extension dam_ttcontent) and publish it. You won’t see the images because the version you edited in fact already was a second version, the first version was created in the live-workspace. Or, alternatively, edit an already existing item in a draft-workspace – you will experience the same behaviour.

I have attached patchfiles for the following extensions and classes:

- tx_dam (tx_dam_db)
- dam_ttcontent
- t3lib_tcemain

I created a new hook in t3lib_tcemain->version_swap to be called after two versions of an element have been swapped. A new function in tx_dam_db (swapMMrefs) is called by this hook. The function checks if the modified table is tt_content and if so, then switches the records in tx_dam_mm_ref.
(issue imported from #M3531)

Reviews 0

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