Hallo Matthias,
nehme den Hook processFormData. Es gibt bestimmt eine bessere Lösung, hatte meine auch eher als Notlösung, weil ich hoffte, dass "der Bug" noch behoben wird...
PHP-Code:
if($arrForm['id'] == 1) //hier Deine Formular-Nummer einsetzen
{
....
//Logo hochgeladen? Dann richtige UUID speichern, nicht den Pfad, wie Contao es aktuell macht
if(count($arrFiles['logo'])>0 && $arrFiles['logo']['error']==0 && $arrFiles['logo']['uploaded']==1) {
$pfad = explode('files', $arrFiles['logo']['tmp_name']);
if(count($pfad)>0) {
$objFile = \FilesModel::findByPath('files'.$pfad[1]);
//print_r($objFile);
if($objFile !== null) {
$set['logo'] = $objFile->uuid;
}
}
}
\Database::getInstance()->prepare("UPDATE tl_table %s WHERE...")->set($set) //die WHERE-Bedingung und Execute-Werte musst Du bei Dir natürlich anpssen
->execute(...);
}
Viele Grüße, Petra
Lesezeichen