Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-47657

Wrong error message when editing own glossary entry after timeout

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.8
    • 2.6.6, 2.7.3
    • Glossary
    • MOODLE_28_STABLE
    • MOODLE_26_STABLE, MOODLE_27_STABLE
    • MDL-47657-master
    • Hide
      1. Create a glossary activity
        • Ensure the "Always allow editing" setting is set to No
        • Leave other settings as defaults
      2. Login as a student
      3. Access the glossary.
      4. Add a new entry with a Concept and Definition
      5. Click the 'Save changes' button.
      6. Click on the editing icon
      7. Make changes to the glossary entry
      8. Click the 'Save changes' button.
      9. VERIFY that no errors are shown
      10. Stay on the Glossary view page (which should show the editing icon) and wait 30min (or less if you can reduce $CFG->maxeditingtime)
      11. Try editing the entry.
      12. VERIFY that a timeout error is shown.
      13. Log in as an admin
      14. Edit the glossary entry
      15. VERIFY that no issues are shown
      Show
      Create a glossary activity Ensure the "Always allow editing" setting is set to No Leave other settings as defaults Login as a student Access the glossary. Add a new entry with a Concept and Definition Click the 'Save changes' button. Click on the editing icon Make changes to the glossary entry Click the 'Save changes' button. VERIFY that no errors are shown Stay on the Glossary view page (which should show the editing icon) and wait 30min (or less if you can reduce $CFG->maxeditingtime) Try editing the entry. VERIFY that a timeout error is shown. Log in as an admin Edit the glossary entry VERIFY that no issues are shown

    Description

      1. Create a glossary activity
        • Ensure the "Always allow editing" setting is set to No
        • Leave other settings as defaults
      2. Login as a student
      3. Access the glossary.
      4. Add a new entry with a Concept and Definition
      5. Click the 'Save changes' button.
      6. Stay on the Glossary view page (which should show the editing icon) and wait 30min (or less if you can reduce $CFG->maxeditingtime)
      7. Try editing the entry.

      Expected result: The user should be shown a timeout error.

      Actual result: An error about the user not being able to edit other's entries is shown.

      You cannot edit other people's entries.
       
      More information about this error
      Debug info:
      Error code: errcannoteditothers
      Stack trace:
       
          line 463 of /lib/setuplib.php: moodle_exception thrown
          line 44 of /mod/glossary/edit.php: call to print_error()
       
      Output buffer: Notice: Undefined variable: fromdb in /var/www/vhosts/qa.moodle.net/html/mod/glossary/edit.php on line 43 Notice: Trying to get property of non-object in /var/www/vhosts/qa.moodle.net/html/mod/glossary/edit.php on line 43 
      

      The problem is that there is an incorrect variable name used on line 44...

              if ($USER->id != $fromdb->userid) {
      

      ...which should be...

              if ($USER->id != $entry->userid) {
      

      Attachments

        Issue Links

          Activity

            People

              davecooper Dave Cooper
              salvetore Michael de Raadt
              Sam Hemelryk Sam Hemelryk
              Dan Poltawski Dan Poltawski
              Mark Nelson Mark Nelson
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Sujith Haridasan
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                10/Nov/14