Commit be0892a2 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Save.php: For Uploads the 'target' variable name renamed (name collison with...

Save.php: For Uploads the 'target' variable name renamed (name collison with native column 'pathFileName') from 'pathFileName' to 'fileDestination'.
parent 0cec5e27
......@@ -446,7 +446,7 @@ const FE_DYNAMIC_UPDATE = 'dynamicUpdate';
const FE_DATE_FORMAT = 'dateFormat'; // value: FORMAT_DATE_INTERNATIONAL | FORMAT_DATE_GERMAN
const FE_SHOW_SECONDS = 'showSeconds'; // value: 0|1
const FE_SHOW_ZERO = 'showZero'; // value: 0|1
const FE_PATH_FILE_NAME = 'pathFileName'; // Target pathFilename for an uploaded file.
const FE_FILE_DESTINATION = 'fileDestination'; // Target pathFilename for an uploaded file.
const FE_SQL_VALIDATE = 'sqlValidate'; // Action: Query to validate form load
const FE_EXPECT_RECORDS = 'expectRecords'; // Action: expected number of rows of FE_SQL_VALIDATE
const FE_MESSAGE_FAIL = 'messageFail'; // Action: Message to display, if FE_SQL_VALIDATE fails.
......
......@@ -203,17 +203,17 @@ class Save {
return '';
}
if (isset($formElement[FE_PATH_FILE_NAME])) {
if (isset($formElement[FE_FILE_DESTINATION])) {
// Provide variable '_filename'. Might be substituted in $formElement[FE_PATH_FILE_NAME].
$origFilename = Sanitize::safeFilename($statusUpload[FILES_NAME]);
$this->store->setVar(CLIENT_UPLOAD_FILENAME, $origFilename, STORE_FORM);
$pathFileName = $this->evaluate->parse($formElement[FE_PATH_FILE_NAME]);
$pathFileName = $this->evaluate->parse($formElement[FE_FILE_DESTINATION]);
}
if ($pathFileName === '') {
throw new UserFormException("Upload failed, no target '" . FE_PATH_FILE_NAME . "' specified.", ERROR_NO_TARGET_PATH_FILE_NAME);
throw new UserFormException("Upload failed, no target '" . FE_FILE_DESTINATION . "' specified.", ERROR_NO_TARGET_PATH_FILE_NAME);
}
if (file_exists($pathFileName)) {
......
......@@ -71,8 +71,8 @@ VALUES
(503, 5, 'datumZeit', 'Datum & Zeit', 'show', 'datetime', 'alnumx', 'native', 50, 0, 0, '', '', '', '', '', '', 0,
'', ''),
(504, 5, 'zeit', 'Zeit', 'show', 'time', 'alnumx', 'native', 60, 0, 0, '', '', '', '', '', '', 0, '', ''),
(505, 5, 'picture', 'Picture', 'show', 'upload', 'allbut', 'native', 70, 0, 0, '', '', '', '', '',
'pathFileName={{SELECT ''fileadmin/user/pictures/'', p.name, ''-{{_filename}}'' FROM Person AS p WHERE p.id={{r}} }}',
(505, 5, 'pathFileName', 'Picture', 'show', 'upload', 'allbut', 'native', 70, 0, 0, '', '', '', '', '',
'fileDestination={{SELECT ''fileadmin/user/pictures/'', p.name, ''-{{_filename}}'' FROM Person AS p WHERE p.id={{r}} }}',
0, '', ''),
(506, 5, '', 'Address', 'show', 'subrecord', 'all', 'native', 100, 0, 0, '', '', '',
......
Supports Markdown
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