From fb02e6f99abb2596bbc4f13a1d2474a68874f8ce Mon Sep 17 00:00:00 2001
From: Quentin RIBAC <quentin.ribac@xelians.fr>
Date: Fri, 19 Aug 2022 10:19:20 +0200
Subject: [PATCH] FIX #20811 TIME 0:10 prevent PHP warnings

---
 src/app/resource/controllers/ResController.php | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/app/resource/controllers/ResController.php b/src/app/resource/controllers/ResController.php
index 6c08f46a828..d0eeec17e21 100755
--- a/src/app/resource/controllers/ResController.php
+++ b/src/app/resource/controllers/ResController.php
@@ -1386,16 +1386,16 @@ class ResController extends ResourceControlController
 
     public function getProcessingData(Request $request, Response $response, array $args)
     {
-        if (!Validator::intVal()->validate($args['groupId'])) {
+        if (!Validator::intVal()->validate($args['groupId'] ?? null)) {
             return $response->withStatus(403)->withJson(['errors' => 'groupId param is not an integer']);
         }
-        if (!Validator::intVal()->validate($args['userId'])) {
+        if (!Validator::intVal()->validate($args['userId'] ?? null)) {
             return $response->withStatus(403)->withJson(['errors' => 'userId param is not an integer']);
         }
-        if (!Validator::intVal()->validate($args['basketId'])) {
+        if (!Validator::intVal()->validate($args['basketId'] ?? null)) {
             return $response->withStatus(403)->withJson(['errors' => 'basketId param is not an integer']);
         }
-        if (!Validator::intVal()->validate($args['resId'])) {
+        if (!Validator::intVal()->validate($args['resId'] ?? null)) {
             return $response->withStatus(403)->withJson(['errors' => 'resId param is not an integer']);
         }
 
@@ -1415,9 +1415,9 @@ class ResController extends ResourceControlController
 
         $listEventData = json_decode($groupBasket[0]['list_event_data'], true);
 
-        if (!!$listEventData['canUpdateData']) {
+        if (!empty($listEventData['canUpdateData'])) {
             $status = StatusModel::getByResId(['select' => ['can_be_modified'], 'resId' => $args['resId'], 'collId' => 'letterbox_coll']);
-            if ($status['can_be_modified'] != 'Y') {
+            if (empty($status['can_be_modified']) || $status['can_be_modified'] != 'Y') {
                 $listEventData['canUpdateData'] = false;
             }
         }
-- 
GitLab