Bug #18311
closed
Remove DAM-References from media field does not work
Added by Christian Trabold over 16 years ago.
Updated over 13 years ago.
Description
There's a strange behavior when storing and deleting DAM-Elements in Media-Field:
1) Everytime the Content-Element gets saved a new MM-Ref gets stored in tx_dam_mm_ref.
2) After removing the DAM-Reference from Media-Field and saving the Content-Element, the References are still there.
This only happens on the Postgres-Environment - on MySQL everything works all fine.
Versions:
TYPO3 4.1.2
DAM 1.0.101
Postgres 8.1.11
(issue imported from #M7672)
Hi Christian,
Can you still reproduce this with the latest version from svn?
Hmm, would like to send you a reminder but there are like 20 Christians registered on bugs.typo3.org :-)
Problem is still (T3 4.2.9, DAM 1.1.1, dam_ttcontent 1.1.0) there, occours also with Oracle 11g.
DBAL-Debug gives following hint:
SELECT "uid_local", "tablenames"
FROM "tx_dam_mm_ref"
WHERE
"uid_foreign" = 61 AND "tablenames" = "tt_content" AND "ident" = 'tx_damttcontent_files'
ORDER BY "sorting_foreign"
1 ORA-00904: "tt_content": ungültiger Bezeichner
So i think, the problem is the wrong escaping of tt_content (its not a table here, but an entry in this column) so it has to escape as 'tt_content' - but i can not find the code where this happens.
fullQuoteStr or QuoteStr should do it...
Problem is located at line 357 in t3lib/class.t3lib_loaddbgroup.php. There the value for the field tablenames isn't quoted properly.
My solution:
// $additionalWhere_tablenames = ' AND tablenames="'.$this->currentTable.'"';
$additionalWhere_tablenames = ' AND tablenames='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this->currentTable, $MM_tableName);
Is this still a problem with current versions (4.5)? There was a lot of action in dbal, maybe this is solved?
- Target version deleted (
907)
- Status changed from Needs Feedback to Closed
- TYPO3 Version set to 4.5
No feedback provided within 90 days. Closing the issue.
Also available in: Atom
PDF