do NOT overwrite everything, if vfs-upload is used without id:

- using fallback id of "file_widget" the client-side uses
- ignore validation, if there is no id
This commit is contained in:
ralf 2022-03-28 13:32:05 +03:00
parent 0f7484812e
commit d8827da73f
2 changed files with 6 additions and 3 deletions

View File

@ -47,6 +47,9 @@ class File extends Etemplate\Widget
if($xml) parent::__construct($xml); if($xml) parent::__construct($xml);
// set fallback-id client-side uses
if (empty($this->id)) $this->id = 'file_widget';
// Legacy multiple - id ends in [] // Legacy multiple - id ends in []
if(substr($this->id,-2) == '[]') if(substr($this->id,-2) == '[]')
{ {

View File

@ -352,7 +352,7 @@ class Vfs extends File
parent::validate($cname, $expand, $content, $validated); parent::validate($cname, $expand, $content, $validated);
break; break;
} }
if (true) $valid = $value; if (!empty($this->id)) $valid = $value;
} }
/** /**