Credit goes to Matt Clarkson. Thanks.
Merged from MOODLE_18_STABLE
require_login($course->id, false, $cm);
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
- if (!$glossary->allowcomments and !has_capability('mod/glossary:comment', $context)) {
+ /// Both the configuration and capability must allow comments
+ if (!$glossary->allowcomments or !has_capability('mod/glossary:comment', $context)) {
error('You can\'t add comments to this glossary!');
}
}
$return .= glossary_print_entry_commentslink($course, $cm, $glossary, $entry,$mode,$hook,'html');
- if (has_capability('mod/glossary:comment', $context)) {
+ if (has_capability('mod/glossary:comment', $context) and $glossary->allowcomments) {
$output = true;
$return .= ' <a title="' . get_string('addcomment','glossary') . '" href="comment.php?action=add&eid='.$entry->id.'"><img src="comment.gif" class="iconsmall" alt="'.get_string('addcomment','glossary').'" /></a>';
}