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

Database error when approving glossary entries

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Glossary
    • Labels:
      None
    • Environment:
      qa.moodle.net

      Description

      When attempting to approve glossary entries on Moodle 2.0 Preview 4 the approval page generates the following error

      Catchable fatal error: Argument 2 passed to moodle_database::get_record() must be an array, string given, called in /html/mod/glossary/approve.php on line 14 and defined in /html/lib/dml/moodle_database.php on line 1166

      This can be fixed by changing both lines 14 and 15 of approve.php

      from:

      $entry = $DB->get_record('glossary_entries', 'id', $eid, '*', MUST_EXIST);
      $glossary = $DB->get_record('glossary', 'id', $entry->glossaryid, '*', MUST_EXIST);

      to:

      $entry = $DB->get_record('glossary_entries', array('id' => $eid) '*', MUST_EXIST);
      $glossary = $DB->get_record('glossary', array('id'=> $entry->glossaryid), '*', MUST_EXIST);

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                24/Nov/10