Add error message when the default customfield values can't be validated

This commit is contained in:
Ivan Nieto Vivanco 2022-06-22 22:17:05 -05:00
parent 7e10abe605
commit 7976401aa2
2 changed files with 8 additions and 2 deletions

View file

@ -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'));
}
}
}

View file

@ -49,6 +49,12 @@ return array(
),
'fieldset_default_value' => array(
'error' => 'Error validating default fieldset values.',
),