Bug nouvelle version : refusé une demande

72 views
Skip to first unread message

GeoHolz

unread,
Jul 25, 2023, 9:58:08 AM7/25/23
to jorani
Bonjour,

Avec la nouvelle version, lorsqu'un manager refuse une demande, que le commentaire soit null ou remplit, cela renvoie une erreur :

An uncaught Exception was encountered
Type: Error

Message: Attempt to assign property "comments" on null


Jon Wright

unread,
Aug 11, 2023, 1:21:57 AM8/11/23
to jorani
I think this is more of a php 8 vs php 7 issue than Jorani issue.

Jon Wright

unread,
Aug 19, 2023, 10:02:38 AM8/19/23
to jorani
This could be a simple fix:

in applications/models/Leaves_model.php

*** 681,686 ****
--- 681,687 ----
          if (isset($json_parsed)){
            array_push($json_parsed->comments, $commentObject);
          }else {
+           $json_parsed = new stdClass;
            $json_parsed->comments = array($commentObject);
          }
          $comment_change = new stdClass;

Reply all
Reply to author
Forward
0 new messages