Trying to get property of non-object error

Trying to get property of non-object error

by Matthew Whelan -
Number of replies: 2

I am receiving an error in the attendance mod and am unsure how to fix it. I'm running Moodle version 2.6.2 and mod_attendance build 2014022801. This is the information in my error log:

PHP Notice:  Undefined variable: sess in /home/xxxx/public_html/mod/attendance/renderer.php on line 819

PHP Notice:  Trying to get property of non-object in /home/xxxx/public_html/mod/attendance/renderer.php on line 819


The code on that section is the following: 

            if ($reportdata->sessionslog) {

                if (isset($reportdata->sessionslog[$user->id][$sess->id]->remarks)) {

                    $row->cells[] = $reportdata->sessionslog[$user->id][$sess->id]->remarks;

                } else {

                    $row->cells[] = '';

                }

            }

If anyone could help me out with this, that would be fantastic.

Average of ratings: -
In reply to Matthew Whelan

Re: Trying to get property of non-object error

by Joël Schmid -

Hello

I got the same error, how did you solve it?


In reply to Joël Schmid

Re: Trying to get property of non-object error

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

HI Joel - thanks for reporting the specific issue you had into the github tracker -this old post refers to a different issue that has probably been fixed by now.

Average of ratings: Useful (1)