Moodle
  1. Moodle
  2. MDL-27521

Clicking Prevent submission updates without a submission causes page to crash

    Details

    • Database:
      Any
    • Testing Instructions:
      Hide
      1. Create a new "Advanced uploading of files" assignment.
      2. Ensure there are students enrolled in the course.
      3. Go to the grades page for the assignment (View submissions link on assignment page).
      4. Click on the 'Grade' button in the status column for a user (that hasn't submitted yet).

      Result:
      the 'Prevent submission updates' button should not be visible

      Show
      Create a new "Advanced uploading of files" assignment. Ensure there are students enrolled in the course. Go to the grades page for the assignment (View submissions link on assignment page). Click on the 'Grade' button in the status column for a user (that hasn't submitted yet). Result: the 'Prevent submission updates' button should not be visible
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      wip-mdl-27521-master
    • Rank:
      17184

      Description

      The 'Prevent submission updates' button on the grade page for a single user doesn't check for an existing submission when it tries to update the submission record to toggle finalize/unfinalize. This causes a db exception (as the record doesn't exist).

      Replication instructions:

      1. Create a new assignment.
      2. Go to the grades page for the assignment (View submissions link on assignment page).
      3. Click on the 'Grade' button in the status column for a user (that hasn't submitted yet).
      4. Click on the 'Prevent submission updates' button

        Activity

        Hide
        Gerwood Stewart added a comment -

        Have a patch available for this issue here: git://github.com/dogma/moodle.git commit: 1dd0ab5 (MDL-27521 branch)

        This is an atomic commit which should fix the issue and can be cherry-picked.

        It corrects the issue by changing can_finalize and can_unfinalize to recognize when a boolean is passed instead of a submission object. This results in the methods returning false, which removes the button on the submission/grade page.

        G

        Show
        Gerwood Stewart added a comment - Have a patch available for this issue here: git://github.com/dogma/moodle.git commit: 1dd0ab5 ( MDL-27521 branch) This is an atomic commit which should fix the issue and can be cherry-picked. It corrects the issue by changing can_finalize and can_unfinalize to recognize when a boolean is passed instead of a submission object. This results in the methods returning false, which removes the button on the submission/grade page. G
        Hide
        Michael de Raadt added a comment -

        I tried to replicate this on a fresh install, but the problem didn't occur for me.

        Could you have a look at what might be different about your instance that is causing this?

        Show
        Michael de Raadt added a comment - I tried to replicate this on a fresh install, but the problem didn't occur for me. Could you have a look at what might be different about your instance that is causing this?
        Hide
        Gerwood Stewart added a comment - - edited

        Checked this from a clean install (today) against 2.0.3+ (Build 20110525). Definitely still there.

        Extra info:
        Installation was Ubuntu, Postgres 8.4, Php 5.3.5

        The install had an empty database, only 1 course created for the testing, 1 assignment for the same and a manual test user.

        Can provide screencast or screenshots of the process if needed.

        An important note is that the user must have never submitted. Otherwise a record will exist that can be updated.

        Show
        Gerwood Stewart added a comment - - edited Checked this from a clean install (today) against 2.0.3+ (Build 20110525). Definitely still there. Extra info: Installation was Ubuntu, Postgres 8.4, Php 5.3.5 The install had an empty database, only 1 course created for the testing, 1 assignment for the same and a manual test user. Can provide screencast or screenshots of the process if needed. An important note is that the user must have never submitted. Otherwise a record will exist that can be updated.
        Hide
        Aparup Banerjee added a comment -

        just adding that i've replicated this on 2.0.3+

        Show
        Aparup Banerjee added a comment - just adding that i've replicated this on 2.0.3+
        Hide
        Ankit Agarwal added a comment -

        Hi Jason and Gerwood,
        Not sure if am doing anything wrong, but I am not able to replicate this.
        Anyways about the patch this needs to be adjusted based on Moodle Coding guidelines..
        Ifs should be properly intended.
        Rest looks good.
        Thanks

        Show
        Ankit Agarwal added a comment - Hi Jason and Gerwood, Not sure if am doing anything wrong, but I am not able to replicate this. Anyways about the patch this needs to be adjusted based on Moodle Coding guidelines.. Ifs should be properly intended. Rest looks good. Thanks
        Hide
        Eloy Lafuente (stronk7) added a comment -

        The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

        TIA and ciao

        Show
        Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
        Hide
        Ankit Agarwal added a comment -

        Hi,
        Testers please note that this is specific to "advance uploading of files" type assignment.
        Thanks

        Show
        Ankit Agarwal added a comment - Hi, Testers please note that this is specific to "advance uploading of files" type assignment. Thanks
        Hide
        Aparup Banerjee added a comment -

        i can't replicate this now - am i missing something? (could this have already been fixed in latest 2.0.x?)

        Show
        Aparup Banerjee added a comment - i can't replicate this now - am i missing something? (could this have already been fixed in latest 2.0.x?)
        Hide
        Aparup Banerjee added a comment -

        Thanks for fixing up the test instructions Jason. This has been integrated and is up for testing.

        Show
        Aparup Banerjee added a comment - Thanks for fixing up the test instructions Jason. This has been integrated and is up for testing.
        Hide
        Rajesh Taneja added a comment -

        Thanks for clear test instructions Jason. It was easy to replicate the issue on stable branches and testing on integration branches

        Works as mentioned.

        Show
        Rajesh Taneja added a comment - Thanks for clear test instructions Jason. It was easy to replicate the issue on stable branches and testing on integration branches Works as mentioned.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Yes, you got this finally upstream, just in time for Moodle 2.2beta. Congrats and thanks!

        Ciao

        Show
        Eloy Lafuente (stronk7) added a comment - Yes, you got this finally upstream, just in time for Moodle 2.2beta. Congrats and thanks! Ciao

          People

          • Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: