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

Sorting submitted assignments by status makes all assignments disappear - again

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Duplicate
    • 1.9.13, 2.0.5, 2.1.2
    • None
    • Assignment (2.2)
    • None
    • Debian testing (with Moodle from moodle.org, not Debian package)
    • MySQL
    • MOODLE_19_STABLE, MOODLE_20_STABLE, MOODLE_21_STABLE

    Description

      The problem described in MDL-10846 appears again in Moodle 1.9 (tested with 1.9.13+ (Build: 20110921)), with exactly the same cause:

      When looking at the list of assignments (by "View ... submitted assignments"), press "status" column title to sort by status. All records disappear. Reason: SQL query generated is invalid, it contains "order by status" but the status field doesn't exist.

      It seems that the fix for MDL-10846 no longer exists in 1.9.x source code. It seems that a fix exists in the latest 2.x source code, although I didn't check does it actually work. So I'm sure this bug affects 1.9.x branch, and I do not know if it affects 2.0.x or 2.1.x.

      I'm attaching a patch that fixes it simply by adding back the status field, but this patch may be suitable only for some databases (like MySQL), for other databases it may break MDL-8164 ("MS SQL cannot return Boolean data type in query results, any code using this returns no results when using Sql 2005").

      Attachments

        Issue Links

          Activity

            People

              stronk7 Eloy Lafuente (stronk7)
              kambi Michalis Kamburelis
              Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
              Votes:
              10 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: