Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error when rejecting a leave request #395

Open
petesharrock opened this issue Jun 21, 2023 · 4 comments
Open

error when rejecting a leave request #395

petesharrock opened this issue Jun 21, 2023 · 4 comments

Comments

@petesharrock
Copy link

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

@Atmis
Copy link

Atmis commented Jun 29, 2023

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.

@GeoHolz
Copy link

GeoHolz commented Jul 25, 2023

Same bug here

@sb01623
Copy link

sb01623 commented Jul 26, 2023

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

@wrigjz
Copy link

wrigjz commented Aug 19, 2023

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;

@Sylvaner Sylvaner mentioned this issue Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants