General developer forum

Undefined property: stdClass::$gradingduedate

Picture of Carmen Griffiths
Undefined property: stdClass::$gradingduedate

Hi Guys and Gals

I cannot find anything so far on this topic, so hoping someone will be able to assist!!

As admin i can create an assignment, but as a student it is not visible. I know it's not the settings, because debug mode is giving me this error:

Notice: Undefined property: stdClass::$gradingduedate in /mod/assign/locallib.php on line 1346

Looking at those lines and checking against a fresh installation, everything is defined: 

I added some java print"" in between and the only one returning is within the "Else statement" so clearly it is not reading that i have disabled the due date or given a due date, it always returns my "print" in the  $DB->delete_records section! Please can someone be so kind to let me know whats happening?

This is line 1346 --> 


        if ($instance->gradingduedate) {

            $event->name = get_string('calendargradingdue', 'assign', $instance->name);

            $event->eventtype = $eventtype;

            $event->timestart = $instance->gradingduedate;

            $event->timesort = $instance->gradingduedate;

            $event->id = $DB->get_field('event', 'id', array('modulename' => 'assign',

                'instance' => $instance->id, 'eventtype' => $event->eventtype));

            // Now process the event.

            if ($event->id) {

                $calendarevent = calendar_event::load($event->id);

                $calendarevent->update($event, false);

            } else {

                calendar_event::create($event, false);


        } else {

            $DB->delete_records('event', array('modulename' => 'assign', 'instance' => $instance->id,

                'eventtype' => $eventtype));


return true;


Average of ratings: -