{"action":"closed","issue":{"url":"https://api.github.com/repos/academic-moodle-cooperation/moodle-mod_organizer/issues/2","labels_url":"https://api.github.com/repos/academic-moodle-cooperation/moodle-mod_organizer/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/academic-moodle-cooperation/moodle-mod_organizer/issues/2/comments","events_url":"https://api.github.com/repos/academic-moodle-cooperation/moodle-mod_organizer/issues/2/events","html_url":"https://github.com/academic-moodle-cooperation/moodle-mod_organizer/issues/2","id":28944347,"number":2,"title":"Problem with the \"Registration Status\" view","user":{"login":"benidroe","id":3896923,"avatar_url":"https://avatars.githubusercontent.com/u/3896923?v=3","gravatar_id":"","url":"https://api.github.com/users/benidroe","html_url":"https://github.com/benidroe","followers_url":"https://api.github.com/users/benidroe/followers","following_url":"https://api.github.com/users/benidroe/following{/other_user}","gists_url":"https://api.github.com/users/benidroe/gists{/gist_id}","starred_url":"https://api.github.com/users/benidroe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benidroe/subscriptions","organizations_url":"https://api.github.com/users/benidroe/orgs","repos_url":"https://api.github.com/users/benidroe/repos","events_url":"https://api.github.com/users/benidroe/events{/privacy}","received_events_url":"https://api.github.com/users/benidroe/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2014-03-07T08:05:23Z","updated_at":"2015-07-14T08:25:56Z","closed_at":"2015-07-14T08:25:56Z","body":"When I click on the \"Registration Status\" view, I see only a debug-info:\r\n\r\nDebug info: ERROR: column \"a2.id\" must appear in the GROUP BY clause or be used in an aggregate function\r\nLINE 4: WHEN a2.id IS NOT NULL AND a2.attended = 1 AND a2.al...\r\n^\r\nSELECT DISTINCT\r\nu.id, u.firstname, u.lastname, u.idnumber,\r\nCASE\r\nWHEN a2.id IS NOT NULL AND a2.attended = 1 AND a2.allownewappointments = 0 THEN 0\r\nWHEN a2.id IS NOT NULL AND a2.attended = 1 AND a2.allownewappointments = 1 THEN 1\r\nWHEN a2.id IS NOT NULL AND a2.attended IS NULL AND a2.starttime <= $1 THEN 2\r\nWHEN a2.id IS NOT NULL AND a2.attended IS NULL AND a2.starttime > $2 THEN 3\r\nWHEN a2.id IS NOT NULL AND a2.attended = 0 AND a2.allownewappointments = 0 THEN 4\r\nWHEN a2.id IS NOT NULL AND a2.attended = 0 AND a2.allownewappointments = 1 THEN 5\r\nWHEN a2.id IS NULL THEN 6\r\nELSE -1\r\nEND AS status,\r\na2.starttime, a2.duration, a2.attended, a2.location, a2.locationlink,\r\na2.grade, a2.comments, a2.teachercomments, a2.feedback, a2.teacherid,\r\na2.userid, a2.teachervisible, a2.slotid, a2.allownewappointments, a2.id AS appid\r\nFROM mdl_user u\r\nLEFT JOIN\r\n(SELECT a.id, a.attended, a.grade, a.feedback, a.comments, a.userid,\r\na.allownewappointments, s.starttime, s.location, s.locationlink, s.teacherid,\r\ns.comments AS teachercomments, s.duration, s.teachervisible, s.id AS slotid\r\nFROM mdl_organizer_slot_appointments a INNER JOIN mdl_organizer_slots s ON a.slotid = s.id\r\nWHERE s.organizerid = $3 ORDER BY a.id DESC) a2 ON u.id = a2.userid\r\nWHERE u.id IN ($4,$5,$6)\r\nGROUP BY u.id\r\nORDER BY status ASC, u.lastname ASC, u.firstname ASC, u.idnumber ASC\r\n[array (\r\n0 => 1394179455,\r\n1 => 1394179455,\r\n2 => '5',\r\n3 => '458',\r\n4 => '4527',\r\n5 => '4380',\r\n)]\r\nError code: dmlreadexception\r\nStack trace:\r\nline 423 of /lib/dml/moodle_database.php: dml_read_exception thrown\r\nline 248 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()\r\nline 753 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()\r\nline 728 of /mod/organizer/view_lib.php: call to pgsql_native_moodle_database->get_records_sql()\r\nline 739 of /mod/organizer/view_lib.php: call to organizer_organizer_get_status_table_entries()\r\nline 156 of /mod/organizer/view_lib.php: call to organizer_organizer_generate_registration_table_content()\r\nline 97 of /mod/organizer/view.php: call to organizer_generate_registration_status_view()"}}