MDL-47657 mod_glossary: Fixed wrong error message on edit timeout.
authorDave Cooper <dave@moodle.com>
Wed, 15 Oct 2014 06:47:08 +0000 (14:47 +0800)
committerDave Cooper <dave@moodle.com>
Wed, 15 Oct 2014 06:48:18 +0000 (14:48 +0800)
mod/glossary/edit.php

index 3ccb42c..ab5b179 100644 (file)
@@ -40,7 +40,7 @@ if ($id) { // if entry is specified
 
     $ineditperiod = ((time() - $entry->timecreated <  $CFG->maxeditingtime) || $glossary->editalways);
     if (!has_capability('mod/glossary:manageentries', $context) and !($entry->userid == $USER->id and ($ineditperiod and has_capability('mod/glossary:write', $context)))) {
-        if ($USER->id != $fromdb->userid) {
+        if ($USER->id != $entry->userid) {
             print_error('errcannoteditothers', 'glossary', "view.php?id=$cm->id&amp;mode=entry&amp;hook=$id");
         } elseif (!$ineditperiod) {
             print_error('erredittimeexpired', 'glossary', "view.php?id=$cm->id&amp;mode=entry&amp;hook=$id");