sf4, adding workflow and fix errors for task bundle

This commit is contained in:
2020-08-04 10:04:25 +02:00
parent f7b5e37079
commit 5292f319be
4 changed files with 18 additions and 11 deletions

View File

@@ -75,7 +75,9 @@ class SingleTaskController extends Controller
;
if ($request->query->has('person_id')) {
$personId = $request->query->getInt('person_id', null);
$personId = $request->query->getInt('person_id', 0); // sf4 check:
// prevent error: `Argument 2 passed to ::getInt() must be of the type int, null given`
if ($personId === null) {
return new Response("You must provide a person_id", Response::HTTP_BAD_REQUEST);
@@ -454,7 +456,9 @@ class SingleTaskController extends Controller
if ($request->query->get('user_id') === '_unassigned') {
$params['unassigned'] = true;
} else {
$userId = $request->query->getInt('user_id', null);
$userId = $request->query->getInt('user_id', 0); // sf4 check:
// prevent error: `Argument 2 passed to ::getInt() must be of the type int, null given`
$user = $this->getDoctrine()->getManager()
->getRepository('ChillMainBundle:User')
->find($userId);
@@ -470,7 +474,9 @@ class SingleTaskController extends Controller
if (!empty($request->query->get('scope_id'))) {
$scopeId = $request->query->getInt('scope_id', null);
$scopeId = $request->query->getInt('scope_id', 0); // sf4 check:
// prevent error: `Argument 2 passed to ::getInt() must be of the type int, null given`
$scope = $this->getDoctrine()->getManager()
->getRepository('ChillMainBundle:Scope')
->find($scopeId);