Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-5135

dmlreadexception for student

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7
    • Fix Version/s: 2.7
    • Component/s: Module: Scheduler
    • Labels:
      None
    • Plugin Version:
      2.x dev (2014052800)
    • Database:
      PostgreSQL
    • Affected Branches:
      MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE

      Description

      Hej,

      I wanted to try out your plugin, but after installing (on Moodle 2.7+) and creating a schedule as admin, I get following exception, when I try to access the schedule:

      Debug info

      ERROR: column "appointcnt" does not exist
      LINE 1: ...3)) HAVING ((s.exclusivity = 0 OR s.exclusivity > appointcnt...
      ^
      SELECT
         s.*, 
         (SELECT COUNT(a.id) FROM mdl2_scheduler_appointment a WHERE a.slotid=s.id) AS appointcnt,
         EXISTS(SELECT 1 FROM mdl2_scheduler_appointment a WHERE    a.slotid=s.id AND a.attended=1) AS isattended
      FROM
         mdl2_scheduler_slots s
      WHERE
         schedulerid = $1 AND
         ((s.starttime > $2) AND
         (s.hideuntil < $3))
      HAVING
         ((s.exclusivity = 0 OR s.exclusivity > appointcnt) AND
         NOT (EXISTS (SELECT 1 FROM mdl2_scheduler_appointment a WHERE a.studentid = $4 and a.slotid=s.id))) OR
         (EXISTS (SELECT 1 FROM mdl2_scheduler_appointment a WHERE a.studentid = $5 and a.slotid=s.id AND a.attended = 0))
      ORDER BY
         s.starttime ASC
      [array (
         0 => '2',
         1 => 1403267332,
         2 => 1403267332,
         3 => '5',
         4 => '5',
      )]
      

      Error code

      dmlreadexception
      

      Stack trace

      line 443 of /lib/dml/moodle_database.php: dml_read_exception thrown
      line 244 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
      line 764 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
      line 242 of /mod/scheduler/model/scheduler_instance.php: call to pgsql_native_moodle_database->get_records_sql()
      line 351 of /mod/scheduler/model/scheduler_instance.php: call to scheduler_instance->fetch_slots()
      line 75 of /mod/scheduler/studentview.php: call to scheduler_instance->get_slots_available_to_student()
      line 92 of /mod/scheduler/view.php: call to include()
      

      I have used standard settings and tried it without defining a slot a with a slot defined (also standard configuration). Both have the same result.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                12/May/14