MDL-56847 tags: exclude modules that are being deleted

we don't check any access for admins for performance reasons, course modules
that are in the process of deletion should be filtered out on the early stage
This commit is contained in:
Marina Glancy 2016-11-15 14:33:46 +08:00
parent 0b8e0c374f
commit 5e5ce443fd
2 changed files with 2 additions and 0 deletions

View File

@ -3607,6 +3607,7 @@ function course_get_tagged_course_modules($tag, $exclusivemode = false, $fromcon
JOIN {course} c ON cm.course = c.id
JOIN {context} ctx ON ctx.instanceid = cm.id AND ctx.contextlevel = :coursemodulecontextlevel
WHERE tt.itemtype = :itemtype AND tt.tagid = :tagid AND tt.component = :component
AND cm.deletioninprogress = 0
AND c.id %COURSEFILTER% AND cm.id %ITEMFILTER%";
$params = array('itemtype' => 'course_modules', 'tagid' => $tag->id, 'component' => 'core',

View File

@ -1771,6 +1771,7 @@ function mod_wiki_get_tagged_pages($tag, $exclusivemode = false, $fromctx = 0, $
JOIN {course} c ON cm.course = c.id
JOIN {context} ctx ON ctx.instanceid = cm.id AND ctx.contextlevel = :coursemodulecontextlevel
WHERE tt.itemtype = :itemtype AND tt.tagid = :tagid AND tt.component = :component
AND cm.deletioninprogress = 0
AND wp.id %ITEMFILTER% AND c.id %COURSEFILTER%";
$params = array('itemtype' => 'wiki_pages', 'tagid' => $tag->id, 'component' => 'mod_wiki',