diff --git a/src/DataForm/Field/File.php b/src/DataForm/Field/File.php index 3be61254..4f362c29 100644 --- a/src/DataForm/Field/File.php +++ b/src/DataForm/Field/File.php @@ -102,7 +102,10 @@ public function autoUpdate($save = false) } }); - $this->model->save(); + + if ($save) { + $this->model->save(); + } } //direct upload diff --git a/src/DataForm/Field/Image.php b/src/DataForm/Field/Image.php index 7c6959cb..b696cb08 100644 --- a/src/DataForm/Field/Image.php +++ b/src/DataForm/Field/Image.php @@ -143,6 +143,7 @@ public function build() $output .= Form::checkbox($this->name.'_remove', 1, (bool) Input::get($this->name.'_remove'))." ".trans('rapyd::rapyd.delete')."
\n"; $output .= ''; } + $this->attributes['multiple accept'] = 'image/jpeg,image/png'; $output .= Form::file($this->name, $this->attributes); break; diff --git a/src/DataForm/Field/Tags.php b/src/DataForm/Field/Tags.php index 3e984ab4..b95ca3b2 100644 --- a/src/DataForm/Field/Tags.php +++ b/src/DataForm/Field/Tags.php @@ -74,8 +74,12 @@ public function getValue() if ($this->is_refill) { $values = explode($this->serialization_sep, $this->value); - $entity = get_class($this->relation->getRelated()); - $related = $entity::whereIn($this->record_id, $values)->get(); + $entity = get_class($this->relation->getRelated()); + if (!empty($values[0])) { + $related = $entity::whereIn($this->record_id, $values)->get(); + }else{ + $related = array(); + } } else { $related = $this->relation->get(); }