Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-29848 glossary: get proper context for comments on exported entry

  • Loading branch information...
commit a7bc85ea032e7b2d691c06dc885d71dd3218d1a9 1 parent e356fb6
Charles Fulton mackensen authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 mod/glossary/lib.php
7 mod/glossary/lib.php
View
@@ -2882,7 +2882,12 @@ function glossary_comment_validate($comment_param) {
if (!$record = $DB->get_record('glossary_entries', array('id'=>$comment_param->itemid))) {
throw new comment_exception('invalidcommentitemid');
}
- if (!$glossary = $DB->get_record('glossary', array('id'=>$record->glossaryid))) {
+ if ($record->sourceglossaryid && $record->sourceglossaryid == $comment_param->cm->instance) {
+ $glossary = $DB->get_record('glossary', array('id'=>$record->sourceglossaryid));
+ } else {
+ $glossary = $DB->get_record('glossary', array('id'=>$record->glossaryid));
+ }
+ if (!$glossary) {
throw new comment_exception('invalidid', 'data');
}
if (!$course = $DB->get_record('course', array('id'=>$glossary->course))) {
Please sign in to comment.
Something went wrong with that request. Please try again.