Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'MDL-29848-22' of https://github.com/mackensen/moodle in…

…to MOODLE_22_STABLE
  • Loading branch information...
commit 6a680dd4aa702106adbca9afc676a0df0716b6f3 2 parents e9ed7e0 + a7bc85e
@nebgor nebgor authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 mod/glossary/lib.php
View
7 mod/glossary/lib.php
@@ -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.