MDL-43736 Events: event->contextinstanceid should be used where possible
While restoring event context might not be present (deleted) So before using context api's check context or use event properties
This commit is contained in:
@@ -355,7 +355,7 @@ abstract class base implements \IteratorAggregate {
|
||||
if (isset($this->context)) {
|
||||
return $this->context;
|
||||
}
|
||||
$this->context = \context::instance_by_id($this->data['contextid'], false);
|
||||
$this->context = \context::instance_by_id($this->data['contextid'], IGNORE_MISSING);
|
||||
return $this->context;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user