mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 06:17:28 -08:00
Add error message when the default customfield values can't be validated
This commit is contained in:
parent
7e10abe605
commit
7976401aa2
|
@ -92,7 +92,7 @@ class AssetModelsController extends Controller
|
|||
if ($model->save()) {
|
||||
if ($this->shouldAddDefaultValues($request->input())) {
|
||||
if (!$this->assignCustomFieldsDefaultValues($model, $request->input('default_values'))){
|
||||
return redirect()->back()->withInput()->withErrors($model->getErrors());
|
||||
return redirect()->back()->withInput()->with('error', trans('admin/custom_fields/message.fieldset_default_value.error'));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -167,7 +167,7 @@ class AssetModelsController extends Controller
|
|||
|
||||
if ($this->shouldAddDefaultValues($request->input())) {
|
||||
if (!$this->assignCustomFieldsDefaultValues($model, $request->input('default_values'))){
|
||||
return redirect()->back()->withInput()->withErrors("Error");
|
||||
return redirect()->back()->withInput()->with('error', trans('admin/custom_fields/message.fieldset_default_value.error'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,6 +49,12 @@ return array(
|
|||
|
||||
),
|
||||
|
||||
'fieldset_default_value' => array(
|
||||
|
||||
'error' => 'Error validating default fieldset values.',
|
||||
|
||||
),
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue