Merge pull request #11002 from inietov/fixes/integrity_constraint_violation_column_order_cannot_be_null

Fixes QueryException Integrity constraint violation:  Column 'order' cannot be null
This commit is contained in:
snipe 2022-05-05 13:27:45 -07:00 committed by GitHub
commit a859eac4a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -195,7 +195,7 @@ class CustomFieldsetsController extends Controller
}
}
$results = $set->fields()->attach($request->input('field_id'), ["required" => ($request->input('required') == "on"),"order" => $request->input('order', 1)]);
$results = $set->fields()->attach($request->input('field_id'), ["required" => ($request->input('required') == "on"),"order" => (int)$request->input('order', 1)]);
return redirect()->route("fieldsets.show", [$id])->with("success", trans('admin/custom_fields/message.field.create.assoc_success'));
}