Commit 9c3482f0 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Try to fix an uninitialised variable for upload

parent 53ea44f5
Pipeline #1369 passed with stage
in 2 minutes and 2 seconds
......@@ -347,7 +347,7 @@ class Save {
$sip = new Sip(false);
$newValues = array();
$vars=array();
$vars = array();
$formValues = $this->store->getStore(STORE_FORM);
$primaryRecord = $this->store->getStore(STORE_RECORD); // necessary to check if the current formElement exist as a column of the primary table.
......@@ -369,20 +369,20 @@ class Save {
}
$column = $formElement[FE_NAME];
$pathFileName = $this->doUpload($formElement, $formValues[$column], $sip, $modeUpload);
$pathFileName = $this->doUpload($formElement, ($formValues[$column]??''), $sip, $modeUpload);
if($modeUpload==UPLOAD_MODE_DELETEOLD && $pathFileName==''){
$pathFileNameTmp=''; // see '4'
if ($modeUpload == UPLOAD_MODE_DELETEOLD && $pathFileName == '') {
$pathFileNameTmp = ''; // see '4'
} else {
if (empty($pathFileName)) {
$pathFileNameTmp = $primaryRecord[$column]??''; // see '3'. Attention: in case of Advanced Upload, $primaryRecord[$column] does not exist.
$pathFileNameTmp = $primaryRecord[$column] ?? ''; // see '3'. Attention: in case of Advanced Upload, $primaryRecord[$column] does not exist.
} else {
$pathFileNameTmp = $pathFileName; // see '1,2,5'
}
}
// Get latest file information
if($pathFileNameTmp=='') {
if ($pathFileNameTmp == '') {
// No new upload and no existing: take care to remove previous upload file statistics.
$this->store->unsetVar(VAR_FILE_MIME_TYPE, STORE_VAR);
$this->store->unsetVar(VAR_FILE_SIZE, STORE_VAR);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment