Index: branches/RC/core/kernel/utility/formatters/upload_formatter.php =================================================================== diff -u -r10579 -r10665 --- branches/RC/core/kernel/utility/formatters/upload_formatter.php (.../upload_formatter.php) (revision 10579) +++ branches/RC/core/kernel/utility/formatters/upload_formatter.php (.../upload_formatter.php) (revision 10665) @@ -25,11 +25,10 @@ */ function Parse($value, $field_name, &$object) { - $ret = ''; + $ret = !is_array($value) ? $value : ''; $options = $object->GetFieldOptions($field_name); - if(getArrayValue($options, 'upload_dir')) - { + if (getArrayValue($options, 'upload_dir')) { $this->DestinationPath = $options['upload_dir']; $this->FullPath = FULL_PATH.$this->DestinationPath; } @@ -49,6 +48,7 @@ $value['upload'] = implode('|', $n_upload); // $value['tmp_ids'] = implode('|', $n_ids); } + if (!$value['tmp_ids']) { $uploaded_files = getArrayValue($value, 'upload'); if (!$uploaded_files && getArrayValue($options, 'required')) { @@ -149,7 +149,9 @@ } } else { - if (getArrayValue($options, 'required')) { + $required_error = is_array($value) || (!is_array($value) && !$value); // input type="file" OR just setting filename (during CSV import) + + if ($required_error && getArrayValue($options, 'required')) { $object->SetError($field_name, 'required'); } } @@ -166,6 +168,7 @@ { $single_mapping = Array ( 'file_urls' => 'full_url', + 'file_paths' => 'full_path', 'file_sizes' => 'file_size', 'files_resized' => 'resize', 'wms' => 'wm', @@ -194,7 +197,7 @@ $format = isset($options['format']) ? $options['format'] : false; } - if ($format && preg_match('/(file_urls|file_names|file_sizes|files_resized|wms)(.*)/', $format, $regs)) { + if ($format && preg_match('/(file_urls|file_paths|file_names|file_sizes|files_resized|wms)(.*)/', $format, $regs)) { if (!$value || $format == 'file_names') { // storage format matches display format OR no value return $value;