fix error with getInt() and inject PaginatorFactory service in EventController

This commit is contained in:
2020-08-04 12:23:10 +02:00
parent d4948b176f
commit 7730f732ed
4 changed files with 18 additions and 13 deletions

View File

@@ -369,7 +369,8 @@ class ParticipationController extends Controller
. "the object manager using the method ".__METHOD__);
}
$event_id = $request->query->getInt('event_id', null);
$event_id = $request->query->getInt('event_id', 0); // sf4 check:
// prevent error: `Argument 2 passed to ::getInt() must be of the type int, null given`
if ($event_id !== NULL) {
$event = $em->getRepository('ChillEventBundle:Event')
@@ -388,9 +389,9 @@ class ParticipationController extends Controller
// this script should be able to handle multiple, so we translate
// single person_id in an array
$persons_ids = $request->query->has('person_id') ?
array($request->query->getInt('person_id', null)):
explode(',', $request->query->get('persons_ids'))
;
[$request->query->getInt('person_id', 0)] // sf4 check:
// prevent error: `Argument 2 passed to ::getInt() must be of the type int, null given`
: explode(',', $request->query->get('persons_ids'));
$participations = array();
foreach($persons_ids as $person_id) {