[TYPO3-UG Universities DE] Zwei Extensions zum FAL -> DAM Problem
Jan Roth
roth at dhbw-mosbach.de
Mon Dec 1 18:08:31 CET 2014
Liebe Kollegen,
im Rahmen unserer Upgrade-Bemühungen sind zwei kleinere Extensions
entstanden (ohne großen Support).
Aber ich denke vielleicht ist es für den einen oder anderen Interessant
der DAM in Verbindung mit verschiedenen Dingen genutzt hat.
Vorausetzung ist dam_falmigration
- http://typo3.org/extensions/repository/view/dhbw_fal_templavoila/
ersetzt quasi dam_tv_connector (Relationen funktionieren auch nach
Migration noch)
- http://typo3.org/extensions/repository/view/dhbw_rgnewsce_ng/ ersetzt
rgnewsce (löst IMAGE-Problem in LIST und LATEST)
Hoffe es hilft dem einen oder anderen Weiter.
Zusätzlich kann ich noch eine Modifikation für dam_falmigration anbieten
falls jemand RTE Felder in Templavoila FCEs einsetzt...
Dadurch werden auch mediatags mit htmlspecialchars (< >) ersetzt.
Kann auch noch nachträglich gestartet werden.
===
dam_falmigration\Classes\Service\MigrateRteMediaTagService.php
===
migrateDamCategoriesToFalCollectionsCommand (zusätzliche Schleife
anhängen)
==
foreach ($records as $rec) {
$originalContent = $rec[$field];
$finalContent = $originalContent;
$results = array();
preg_match_all('/<media
([0-9]+)([^&]*)>(.*?)<\/media>/', $originalContent, $results,
PREG_SET_ORDER);
if (count($results)) {
foreach ($results as $result) {
$searchString = $result[0];
$damUid = $result[1];
// see
EXT:dam/mediatag/class.tx_dam_rtetransform_mediatag.php
list($linkTarget, $linkClass,
$linkTitle) = explode(' ', trim($result[2]), 3);
$linkText = $result[3];
$this->parent->message('Replacing
"' . $result[0] . '" with DAM UID ' . $damUid . ' (target ' . $linkTarget
. '; class ' . $linkClass . '; title "' . $linkTitle . '") and linktext "'
. $linkText . '"');
/**
* after migration of DAM-Records
we can find sys_file-UID with help of
* DAM-UID fetch the DAM uid from
sys_file and replace the full tag with a
* valid href="file:FALUID"
* <link file:29643 - download>My
link to a file</link>
*/
$getSysFileUidStatement->execute(array(':migrateddamuid' =>
(int)$damUid));
$falRecord =
$getSysFileUidStatement->fetch();
if (is_array($falRecord)) {
$replaceString = '<link
file:' . $falRecord['uid'] . ' ' . $result[2] . '>' . $linkText .
'</link>';
$finalContent =
str_replace($searchString, $replaceString, $finalContent);
} else {
$this->parent->warningMessage('No FAL record found for dam uid: ' .
$damUid);
}
}
// update the record
if ($finalContent !== $originalContent) {
$this->database->exec_UPDATEquery(
$table,
'uid=' . $rec['uid'],
array($field =>
$finalContent)
);
$this->parent->infoMessage('Updated ' . $table . ':' . $rec['uid'] . '
with: ' . $finalContent);
$this->amountOfMigratedRecords++;
}
} else {
$this->parent->warningMessage('Nothing
found: ' . $originalContent);
}
}
==
getRecords
==
'deleted=0 AND ' . $field . ' LIKE "%<media%" OR ' . $field . ' LIKE
"%<media%"'
Mit freundlichen Grüßen
Jan Roth
Webadministrator
Duale Hochschule Baden-Württemberg Mosbach
Baden-Württemberg Cooperative State University Mosbach
Lohrtalweg 10
74821 Mosbach
Tel.: +49 6261 939-269
Fax: +49 6261 939-414
www.dhbw-mosbach.de
More information about the TYPO3-UG-Universities-DE
mailing list