Moodle
  1. Moodle
  2. MDL-29928

Sorting submitted assignments by status makes all assignments disappear - again

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Duplicate
    • Affects Version/s: 1.9.13, 2.0.5, 2.1.2
    • Fix Version/s: None
    • Component/s: Assignment (2.2)
    • Labels:
      None
    • Environment:
      Debian testing (with Moodle from moodle.org, not Debian package)
    • Database:
      MySQL
    • Affected Branches:
      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").

        Gliffy Diagrams

          Issue Links

            Activity

            Michalis Kamburelis created issue -
            Michalis Kamburelis made changes -
            Field Original Value New Value
            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 the fix is only in the latest 2.x source code.

            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").
            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").
            Charles Fulton made changes -
            Link This issue is a regression caused by MDL-27638 [ MDL-27638 ]
            Marina Glancy made changes -
            Priority Minor [ 4 ] Blocker [ 1 ]
            Affects Version/s 2.1.2 [ 10851 ]
            Affects Version/s 2.0.5 [ 10950 ]
            Aparup Banerjee made changes -
            Assignee moodle.com [ moodle.com ] Aparup Banerjee [ nebgor ]
            Stephen Bourget made changes -
            Link This issue is duplicated by MDL-29529 [ MDL-29529 ]
            Stephen Bourget made changes -
            Link This issue has a non-specific relationship to MDL-29851 [ MDL-29851 ]
            Eloy Lafuente (stronk7) made changes -
            Status Open [ 1 ] Closed [ 6 ]
            Assignee Aparup Banerjee [ nebgor ] Eloy Lafuente (stronk7) [ stronk7 ]
            Resolution Duplicate [ 3 ]
            Michael de Raadt made changes -
            Link This issue duplicates MDL-29529 [ MDL-29529 ]
            Michael de Raadt made changes -
            Link This issue is duplicated by MDL-29529 [ MDL-29529 ]

              People

              • Votes:
                10 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: