[TYPO3-project-formidable] UPLOAD or FILE renderlet

Manuel Rego Casasnovas mrego at igalia.com
Tue Oct 30 09:30:53 CET 2007


Hi,

Manuel Rego Casasnovas escribió:
> I'm testing this option and I have found a bug.
>
> When I delete an image the file is deleted, however the field into
> database isn't updated.
> And when I submit the form or reload the page the deleted image appears
> again (the file doesn't exists, only the name of the image into the
> database).
>   

I have modified the function deleteFile to modify database when you use
this method:
        function deleteFile($sFile) {
                $aValues = t3lib_div::trimExplode(",", $this->_getValue());
                unset($aValues[array_search($sFile, $aValues)]);
                @unlink($this->getFullServerPath($sFile));
                $value = implode(",", $aValues);
                $this->setValue(implode(",", $aValues));

                $tablename =
$this->oForm->_navConf("/control/datahandler/tablename");
                $keyname =
$this->oForm->_navConf("/control/datahandler/keyname");
                $entryid = $this->oForm->oDataHandler->_currentEntryId();
                $fieldname = $this->_getName();
                $value = $this->_getValue();
                @$GLOBALS['TYPO3_DB']->exec_UPDATEquery($tablename,
$keyname . '="' . $entryid . '"', array($fieldname => $value));
        }

I don't know if this is the better way to solve this.
What is your opinion?


Best regards,
   Rego

-- 
Manuel Rego Casasnovas
Computer Science Engineer
mailto:mrego at igalia.com
Tel: +34 986 10 76 10
Fax: +34 981 91 39 49
Igalia - http://www.igalia.com



More information about the TYPO3-project-formidable mailing list