Merge branch 'MDL-72052' of git://github.com/danmarsden/moodle
This commit is contained in:
@@ -43,7 +43,10 @@ function assignsubmission_comments_comment_validate(stdClass $options) {
|
||||
$context = $options->context;
|
||||
|
||||
require_once($CFG->dirroot . '/mod/assign/locallib.php');
|
||||
$assignment = new assign($context, null, null);
|
||||
static $assignment = null;
|
||||
if (is_null($assignment) || $assignment->get_context() != $context) {
|
||||
$assignment = new assign($context, null, null);
|
||||
}
|
||||
|
||||
if ($assignment->get_instance()->id != $submission->assignment) {
|
||||
throw new comment_exception('invalidcontext');
|
||||
@@ -71,7 +74,10 @@ function assignsubmission_comments_comment_permissions(stdClass $options) {
|
||||
$context = $options->context;
|
||||
|
||||
require_once($CFG->dirroot . '/mod/assign/locallib.php');
|
||||
$assignment = new assign($context, null, null);
|
||||
static $assignment = null;
|
||||
if (is_null($assignment) || $assignment->get_context() != $context) {
|
||||
$assignment = new assign($context, null, null);
|
||||
}
|
||||
|
||||
if ($assignment->get_instance()->id != $submission->assignment) {
|
||||
throw new comment_exception('invalidcontext');
|
||||
|
||||
Reference in New Issue
Block a user