mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
Merge branch 'MDL-29848-master' of https://github.com/mackensen/moodle
This commit is contained in:
commit
aa4edcf614
@ -2890,7 +2890,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))) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user