mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Merge pull request #13758 from inietov/fixes/array_to_string_conversion_rb17355
Fixed ErrorException: Array to String Conversion rb17355
This commit is contained in:
commit
38066bf162
|
@ -530,7 +530,6 @@ class AssetsController extends Controller
|
|||
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||
* @param \App\Http\Requests\ImageUploadRequest $request
|
||||
* @since [v4.0]
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function store(ImageUploadRequest $request)
|
||||
{
|
||||
|
|
|
@ -220,8 +220,6 @@ class Asset extends Depreciable
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
return parent::save($params);
|
||||
}
|
||||
|
||||
|
|
|
@ -92,6 +92,8 @@ class CustomFieldset extends Model
|
|||
|
||||
array_push($rule, $field->attributes['format']);
|
||||
$rules[$field->db_column_name()] = $rule;
|
||||
//add not_array to rules for all fields
|
||||
$rules[$field->db_column_name()][] = 'not_array';
|
||||
}
|
||||
|
||||
return $rules;
|
||||
|
|
|
@ -232,6 +232,10 @@ class ValidationServiceProvider extends ServiceProvider
|
|||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
Validator::extend('not_array', function ($attribute, $value, $parameters, $validator) {
|
||||
return !is_array($value);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -95,6 +95,7 @@ return [
|
|||
'url' => 'The :attribute format is invalid.',
|
||||
'unique_undeleted' => 'The :attribute must be unique.',
|
||||
'non_circular' => 'The :attribute must not create a circular reference.',
|
||||
'not_array' => 'The :attribute field cannot be an array.',
|
||||
'disallow_same_pwd_as_user_fields' => 'Password cannot be the same as the username.',
|
||||
'letters' => 'Password must contain at least one letter.',
|
||||
'numbers' => 'Password must contain at least one number.',
|
||||
|
|
Loading…
Reference in a new issue