Merge pull request #10480 from snipe/fixes/check_for_valid_custom_field

Fixed format property on invalid custom field object when trying to edit a field that doesn't exist
This commit is contained in:
snipe 2022-01-03 19:28:25 -08:00 committed by GitHub
commit b78e610ce3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -178,7 +178,7 @@ class CustomFieldsController extends Controller
*/
public function edit($id)
{
$field = CustomField::find($id);
if ($field = CustomField::find($id)) {
$this->authorize('update', $field);
@ -194,6 +194,11 @@ class CustomFieldsController extends Controller
]);
}
return redirect()->route("fields.index")
->with("error", trans('admin/custom_fields/message.field.invalid'));
}
/**
* Store the updated field