Moodle
  1. Moodle
  2. MDL-29529

Error reading from database - Unknown column 'status' in 'order clause'

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.9.14, 2.0.5, 2.1.2, 2.2
    • Fix Version/s: 1.9.15, 2.0.6, 2.1.3
    • Component/s: Assignment (2.2)
    • Labels:
    • Environment:
      Moodle 2.1.1+, build 20110916, upgraded from 2.1.
      Debian GNU/Linux 6.0.2 (squeeze); Apache/2.2.16 (Debian); PHP 5.3.3-7+squeeze3 with Suhosin-Patch; mysql Ver 14.14 Distrib 5.1.49.
    • Database:
      MySQL
    • Testing Instructions:
      Hide

      1 Click on an Assignment activity with submitted assignments.
      2 Click on the "View n submitted assignments" link. A summary table appears.
      3 Click on the 'Status' column header, to sort the table by status.
      4 Verify that the column sorts by status.
      5 Click on any entry in the status column.
      6 Verify that the page loads without error.

      Show
      1 Click on an Assignment activity with submitted assignments. 2 Click on the "View n submitted assignments" link. A summary table appears. 3 Click on the 'Status' column header, to sort the table by status. 4 Verify that the column sorts by status. 5 Click on any entry in the status column. 6 Verify that the page loads without error.
    • Workaround:
      Hide

      No workaround, but initially the table works, and can be sorted by other criteria without this issue.

      Show
      No workaround, but initially the table works, and can be sorted by other criteria without this issue.
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE, MOODLE_21_STABLE
    • Pull from Repository:
    • Rank:
      19006

      Description

      When ordering submitted assignments by status, an error is received:

      "Error reading from database - Unknown column 'status' in 'order clause'"

      Using the back button on this page causes the page which previously worked fine to fail with an identical error.

      Full error:

      Debug info: Unknown column 'status' in 'order clause'
      SELECT u.id,u.picture,u.firstname,u.lastname,u.imagealt,u.email,
      s.id AS submissionid, s.grade, s.submissioncomment,
      s.timemodified, s.timemarked FROM mdl_user u LEFT JOIN mdl_assignment_submissions s ON u.id = s.userid
      AND s.assignment = 591 WHERE u.id IN (631,868,2051,2057,2058,2070,2071,2087,2094,2095,2096,2097,2098,2099,2100,2102,2434,2436,2833,2836,2838,3112,3113,3115,3226,3373,3967,915,3930,4226) ORDER BY status ASC, lastname ASC
      [array (
      )]
      Stack trace:
      
          line 394 of /lib/dml/moodle_database.php: dml_read_exception thrown
          line 795 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
          line 1325 of /mod/assignment/lib.php: call to mysqli_native_moodle_database->get_records_sql()
          line 649 of /mod/assignment/lib.php: call to assignment_base->display_submissions()
          line 57 of /mod/assignment/submissions.php: call to assignment_base->submissions()

      Replication steps:

      1. Click on an Assignment activity with submitted assignments.
      2. Click on the "View n submitted assignments" link. A summary table appears. Note that at this point, everything is fine. The URL is along the lines of: http://moodle.domain.com/mod/assignment/submissions.php?id=29526
      3. Click on the 'Status' column header, to sort the table by status. At this point, the above error is received. (This page uses the URL: http://moodle.comain.com/mod/assignment/submissions.php?id=29526&currentgroup=&tsort=status)
      4. Clicking the browser's back button to get to the previously working page (with the URL as in 2, above) also now results in this error and stack trace.
      5. Logging out and in again (clearing the user session?) appears to slightly fix the issue: at least the page in 2, above, can be reached again.

        Issue Links

          Activity

          Paul Vaughan created issue -
          Michael de Raadt made changes -
          Field Original Value New Value
          Fix Version/s STABLE backlog [ 10463 ]
          Testing Instructions 1. Click on an Assignment activity with submitted assignments.

          2. Click on the "View n submitted assignments" link. A summary table appears. Note that at this point, everything is fine. The URL is along the lines of: http://moodle.domain.com/mod/assignment/submissions.php?id=29526

          3. Click on the 'Status' column header, to sort the table by status. At this point, the above error is received. (This page uses the URL: http://moodle.comain.com/mod/assignment/submissions.php?id=29526&currentgroup=&tsort=status)

          4. Clicking the browser's back button to get to the previously working page (with the URL as in 2, above) also now results in this error and stack trace.

          5. Logging out and in again (clearing the user session?) appears to slightly fix the issue: at least the page in 2, above, can be reached again.



          Description When ordering submitted assignments by status, an error is received:

          "Error reading from database - Unknown column 'status' in 'order clause'"

          Using the back button on this page causes the page which previously worked fine to fail with an identical error.

          Full error:

          Debug info: Unknown column 'status' in 'order clause'
          SELECT u.id,u.picture,u.firstname,u.lastname,u.imagealt,u.email,
          s.id AS submissionid, s.grade, s.submissioncomment,
          s.timemodified, s.timemarked FROM mdl_user u LEFT JOIN mdl_assignment_submissions s ON u.id = s.userid
          AND s.assignment = 591 WHERE u.id IN (631,868,2051,2057,2058,2070,2071,2087,2094,2095,2096,2097,2098,2099,2100,2102,2434,2436,2833,2836,2838,3112,3113,3115,3226,3373,3967,915,3930,4226) ORDER BY status ASC, lastname ASC
          [array (
          )]
          Stack trace:

              line 394 of /lib/dml/moodle_database.php: dml_read_exception thrown
              line 795 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
              line 1325 of /mod/assignment/lib.php: call to mysqli_native_moodle_database->get_records_sql()
              line 649 of /mod/assignment/lib.php: call to assignment_base->display_submissions()
              line 57 of /mod/assignment/submissions.php: call to assignment_base->submissions()
          When ordering submitted assignments by status, an error is received:

          "Error reading from database - Unknown column 'status' in 'order clause'"

          Using the back button on this page causes the page which previously worked fine to fail with an identical error.

          Full error:

          {noformat}Debug info: Unknown column 'status' in 'order clause'
          SELECT u.id,u.picture,u.firstname,u.lastname,u.imagealt,u.email,
          s.id AS submissionid, s.grade, s.submissioncomment,
          s.timemodified, s.timemarked FROM mdl_user u LEFT JOIN mdl_assignment_submissions s ON u.id = s.userid
          AND s.assignment = 591 WHERE u.id IN (631,868,2051,2057,2058,2070,2071,2087,2094,2095,2096,2097,2098,2099,2100,2102,2434,2436,2833,2836,2838,3112,3113,3115,3226,3373,3967,915,3930,4226) ORDER BY status ASC, lastname ASC
          [array (
          )]
          Stack trace:

              line 394 of /lib/dml/moodle_database.php: dml_read_exception thrown
              line 795 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
              line 1325 of /mod/assignment/lib.php: call to mysqli_native_moodle_database->get_records_sql()
              line 649 of /mod/assignment/lib.php: call to assignment_base->display_submissions()
              line 57 of /mod/assignment/submissions.php: call to assignment_base->submissions(){noformat}

          Replication steps:
          # Click on an Assignment activity with submitted assignments.
          # Click on the "View n submitted assignments" link. A summary table appears. Note that at this point, everything is fine. The URL is along the lines of: http://moodle.domain.com/mod/assignment/submissions.php?id=29526
          # Click on the 'Status' column header, to sort the table by status. At this point, the above error is received. (This page uses the URL: http://moodle.comain.com/mod/assignment/submissions.php?id=29526&currentgroup=&tsort=status)
          # Clicking the browser's back button to get to the previously working page (with the URL as in 2, above) also now results in this error and stack trace.
          # Logging out and in again (clearing the user session?) appears to slightly fix the issue: at least the page in 2, above, can be reached again.
          Labels triaged
          Stephen Bourget made changes -
          Link This issue duplicates MDL-29928 [ MDL-29928 ]
          Stephen Bourget made changes -
          Assignee moodle.com [ moodle.com ] Stephen Bourget [ sbourget ]
          Stephen Bourget made changes -
          Testing Instructions 1 Click on an Assignment activity with submitted assignments.
          2 Click on the "View n submitted assignments" link. A summary table appears.
          3 Click on the 'Status' column header, to sort the table by status.
          4 Verify that the column sorts by status.
          5 Click on any entry in the status column.
          6 Verify that the page loads without error.
          Pull 2.1 Branch mdl-29529-assignment-submission-sorting
          Pull 2.1 Diff URL https://github.com/sbourget/moodle/compare/MOODLE_21_STABLE...mdl-29529-assignment-submission-sorting
          Pull from Repository git://github.com/sbourget/moodle.git
          Stephen Bourget made changes -
          Status Open [ 1 ] Waiting for peer review [ 10012 ]
          Stephen Bourget made changes -
          Labels triaged patch triaged
          Jason Fowler made changes -
          Original Estimate 0 minutes [ 0 ]
          Remaining Estimate 0 minutes [ 0 ]
          Status Waiting for peer review [ 10012 ] Peer review in progress [ 10013 ]
          Peer reviewer phalacee
          Stephen Bourget made changes -
          Pull Master Diff URL https://github.com/sbourget/moodle/compare/master...mdl-29529-assignment-submission-sorting-master
          Pull Master Branch mdl-29529-assignment-submission-sorting-master
          Pull 2.0 Diff URL https://github.com/sbourget/moodle/compare/MOODLE_20_STABLE...mdl-29529-assignment-submission-sorting-m20
          Pull 2.0 Branch mdl-29529-assignment-submission-sorting-m20
          Jason Fowler made changes -
          Status Peer review in progress [ 10013 ] Waiting for integration review [ 10010 ]
          Eloy Lafuente (stronk7) made changes -
          Currently in integration Yes [ 10041 ]
          Eloy Lafuente (stronk7) made changes -
          Status Waiting for integration review [ 10010 ] Integration review in progress [ 10004 ]
          Integrator stronk7
          Eloy Lafuente (stronk7) made changes -
          Priority Minor [ 4 ] Blocker [ 1 ]
          Eloy Lafuente (stronk7) made changes -
          Status Integration review in progress [ 10004 ] Reopened [ 4 ]
          Eloy Lafuente (stronk7) made changes -
          Affects Version/s 2.1.2 [ 10851 ]
          Affects Version/s 2.0.5 [ 10950 ]
          Affects Version/s 1.9.14 [ 10951 ]
          Affects Version/s 2.2 [ 10656 ]
          Affects Version/s 2.1.1 [ 10750 ]
          Eloy Lafuente (stronk7) made changes -
          Link This issue is a regression caused by MDL-27638 [ MDL-27638 ]
          Stephen Bourget made changes -
          Pull Master Diff URL https://github.com/sbourget/moodle/compare/master...mdl-29529-assignment-submission-sorting-master
          Pull Master Branch mdl-29529-assignment-submission-sorting-master
          Pull 2.0 Diff URL https://github.com/sbourget/moodle/compare/MOODLE_20_STABLE...mdl-29529-assignment-submission-sorting-m20
          Pull 2.0 Branch mdl-29529-assignment-submission-sorting-m20
          Pull 1.9 Branch mdl-29529-assignment-submission-sorting-m19
          Pull 1.9 Diff URL https://github.com/sbourget/moodle/compare/MOODLE_19_STABLE...mdl-29529-assignment-submission-sorting-m19
          Pull 2.1 Branch mdl-29529-assignment-submission-sorting mdl-29529-assignment-submission-sorting-m21-2
          Pull 2.1 Diff URL https://github.com/sbourget/moodle/compare/MOODLE_21_STABLE...mdl-29529-assignment-submission-sorting https://github.com/sbourget/moodle/compare/MOODLE_21_STABLE...mdl-29529-assignment-submission-sorting-m21-2
          Stephen Bourget made changes -
          Status Reopened [ 4 ] Development in progress [ 3 ]
          Eloy Lafuente (stronk7) made changes -
          Status Development in progress [ 3 ] Waiting for integration review [ 10010 ]
          Eloy Lafuente (stronk7) made changes -
          Status Waiting for integration review [ 10010 ] Integration review in progress [ 10004 ]
          Eloy Lafuente (stronk7) made changes -
          Status Integration review in progress [ 10004 ] Waiting for testing [ 10005 ]
          Fix Version/s 1.9.15 [ 11252 ]
          Fix Version/s 2.0.6 [ 11250 ]
          Fix Version/s 2.1.3 [ 11251 ]
          Fix Version/s STABLE backlog [ 10463 ]
          Adrian Greeve made changes -
          Status Waiting for testing [ 10005 ] Testing in progress [ 10011 ]
          Tester abgreeve
          Adrian Greeve made changes -
          Status Testing in progress [ 10011 ] Tested [ 10006 ]
          Eloy Lafuente (stronk7) made changes -
          Status Tested [ 10006 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Currently in integration Yes [ 10041 ]
          Integration date 15/Nov/11
          Michael de Raadt made changes -
          Link This issue is duplicated by MDL-30416 [ MDL-30416 ]
          Michael de Raadt made changes -
          Link This issue is duplicated by MDL-29928 [ MDL-29928 ]
          Michael de Raadt made changes -
          Link This issue duplicates MDL-29928 [ MDL-29928 ]
          Michael de Raadt made changes -
          Link This issue is duplicated by MDL-30732 [ MDL-30732 ]
          Michael de Raadt made changes -
          Link This issue is duplicated by MDL-35909 [ MDL-35909 ]

            People

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

              Dates

              • Created:
                Updated:
                Resolved: