Skip to content

Commit

Permalink
Merge branch 'MDL-62463-master' of git://github.com/andrewnicols/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta committed May 16, 2018
2 parents dc69734 + 39da8c1 commit 6c32ea4
Showing 1 changed file with 23 additions and 8 deletions.
31 changes: 23 additions & 8 deletions mod/glossary/classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,18 +130,33 @@ public static function export_user_data(approved_contextlist $contextlist) {
FROM {glossary_entries} ge
JOIN {glossary} g ON ge.glossaryid = g.id
JOIN {course_modules} cm ON g.id = cm.instance
JOIN {context} c ON cm.id = c.instanceid
JOIN {modules} m ON cm.module = m.id AND m.name = :modulename
JOIN {context} c ON cm.id = c.instanceid AND c.contextlevel = :contextlevel
WHERE c.id {$contextsql}
AND ge.userid = :userid
OR EXISTS (SELECT 1 FROM {comments} com WHERE com.commentarea = :commentarea AND com.itemid = ge.id
AND com.userid = :commentuserid)
OR EXISTS (SELECT 1 FROM {rating} r WHERE r.contextid = c.id AND r.itemid = ge.id
AND r.component = :ratingcomponent
AND r.ratingarea = :ratingarea
AND r.userid = :ratinguserid)
AND (
ge.userid = :userid
OR
EXISTS (
SELECT 1
FROM {comments} com
WHERE com.commentarea = :commentarea AND com.itemid = ge.id AND com.userid = :commentuserid
)
OR
EXISTS (
SELECT 1
FROM {rating} r
WHERE r.contextid = c.id
AND r.itemid = ge.id
AND r.component = :ratingcomponent
AND r.ratingarea = :ratingarea
AND r.userid = :ratinguserid
)
)
ORDER BY ge.id, cm.id";
$params = [
'userid' => $user->id,
'modulename' => 'glossary',
'contextlevel' => CONTEXT_MODULE,
'commentarea' => 'glossary_entry',
'commentuserid' => $user->id,
'ratingcomponent' => 'mod_glossary',
Expand Down

0 comments on commit 6c32ea4

Please sign in to comment.