From 513fd2351a88ba7f158c678a1f745f3591d95a62 Mon Sep 17 00:00:00 2001 From: Van Korn Date: Fri, 2 Dec 2016 16:01:50 +0500 Subject: [PATCH 1/2] Fixed bug with saving File --- src/DataForm/Field/File.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 From 01c8dd7e16c887f97dd07f48708c565b1302c887 Mon Sep 17 00:00:00 2001 From: Van Korn Date: Thu, 12 Jan 2017 19:55:02 +0500 Subject: [PATCH 2/2] Fix Image,Tags fields --- src/DataForm/Field/Image.php | 1 + src/DataForm/Field/Tags.php | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) 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(); }