jorani icon indicating copy to clipboard operation
jorani copied to clipboard

error when rejecting a leave request

Open petesharrock opened this issue 1 year ago • 4 comments

Github issue tracker is used for bug only. For general questions and requests, please join the Google group

Don't hesitate to provide screenshots.

What is the version of Jorani? Jorani v1.0 PHP 8.2.6

Expected behavior, request rejected with comments

Actual behavior

An uncaught Exception was encountered Type: Error

Message: Attempt to assign property "comments" on null

Filename: D:\WWWRoot\joraniSAML\application\models\Leaves_model.php

Line Number: 682

Steps to reproduce the behavior: Reject a leave request

petesharrock avatar Jun 21 '23 15:06 petesharrock

I confirm I have the exact same issue, with latest Jorani release from May 1st 2023, PHP 8.2.7.

Issue is here whether you enter a comment or not for the reject.

Atmis avatar Jun 29 '23 07:06 Atmis

Same bug here

GeoHolz avatar Jul 25 '23 13:07 GeoHolz

Hello, I have the same error message... Any update about this? Do we have a workaround?

sb01623 avatar Jul 26 '23 10:07 sb01623

This seems to be a one-line fix: application/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;

wrigjz avatar Aug 19 '23 14:08 wrigjz