From f7610cd6d6ed8b18a9b1a7d04ba67e8368b95b8f Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 2 Dec 2014 19:17:03 +0000 Subject: [PATCH] do not validate vfs-widgets not returning a value, as it overwrites preserved values with null --- etemplate/inc/class.etemplate_widget_vfs.inc.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/etemplate/inc/class.etemplate_widget_vfs.inc.php b/etemplate/inc/class.etemplate_widget_vfs.inc.php index 800e031421..0e04f9bd91 100644 --- a/etemplate/inc/class.etemplate_widget_vfs.inc.php +++ b/etemplate/inc/class.etemplate_widget_vfs.inc.php @@ -149,6 +149,11 @@ error_log(lang('Error copying uploaded file to vfs!')); */ public function validate($cname, array $expand, array $content, &$validated=array()) { + // do not validate, as it would overwrite preserved values with null! + if (in_array($this->type, array('vfs-size', 'vfs-uid', 'vfs-gid', 'vfs', 'vfs-mime'))) + { + return; + } $form_name = self::form_name($cname, $this->id, $expand); $value = $value_in = self::get_array($content, $form_name); $valid =& self::get_array($validated, $form_name, true);