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

Incorrect usage of assign class in override codes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2.2
    • Fix Version/s: 3.2.3
    • Component/s: Assignment
    • Labels:
    • Testing Instructions:
      Hide
      Setup
      1. Create a course with students s1 and s2.
      2. Create 2 groups in the course g1 and g2
      3. Create an assignment with a due date.
      User overrides
      1. On the assignment's page, open the settings menu and select "User overrides".
      2. Click "Add user override".
      3. Check the due date field.
        • Confirm that its initial value matches the assignment's original due date.
      4. Override the due date for s1 with a date 1 day later than the original.
      5. Click "Save"
        • Confirm that the user override for s1 gets created.
      6. Edit the user override and set a different due date and click "Save"
        • Confirm that the user override for s1 gets successfully updated.
      7. Click on the duplicate icon to duplicate the user override.
      8. On the user override form, select s2 and select a different due date for the override.
      9. Click "Save"
        • Confirm that the user override for s2 gets created.
      10. Delete the user override for s2.
        • Confirm that the user override for s2 gets successfully deleted.
      Group overrides
      1. Go back to the assignment and open the settings menu again and select "Group overrides"
      2. Click "Add group override".
      3. Check the due date field.
        • Confirm that its initial value matches the assignment's original due date.
      4. Override the due date for g1 with a date 2 days later than the original.
      5. Click "Save and enter another overide"
        • Confirm that the group override is saved there is no error message displayed.
      6. Override the due date for g2 with a date 3 days later than the original.
      7. Click "Save"
        • Confirm that the group overrides for g1 and g2 are displayed in the assignment's group overrides page.
      8. Move the override for g1 below the override for g2.
        • Confirm that the operation is successful and you don't get an error message.
      9. Refresh the page.
        • Confirm that g1 is still below g2.
      10. Move back the override for g1 above the override for g2.
        • Confirm that the operation is successful and you don't get an error message.
      11. Refresh the page.
        • Confirm that g1 is still above g2.
      12. Delete the group override for g1.
        • Confirm that the group override for g1 gets successfully deleted and that you don't see an error message.
      Assignment deletion
      1. Go back to the course page and turn editing on.
      2. Delete the assignment. (You might also have to run cron "php admin/cli/cron.php" to process activity deletion)
        • Confirm that you are able to successfully delete the assignment and that you don't see any error message.
      Show
      Setup Create a course with students s1 and s2. Create 2 groups in the course g1 and g2 Create an assignment with a due date. User overrides On the assignment's page, open the settings menu and select " User overrides ". Click " Add user override ". Check the due date field. Confirm that its initial value matches the assignment's original due date. Override the due date for s1 with a date 1 day later than the original. Click " Save " Confirm that the user override for s1 gets created. Edit the user override and set a different due date and click " Save " Confirm that the user override for s1 gets successfully updated. Click on the duplicate icon to duplicate the user override. On the user override form, select s2 and select a different due date for the override. Click " Save " Confirm that the user override for s2 gets created. Delete the user override for s2. Confirm that the user override for s2 gets successfully deleted. Group overrides Go back to the assignment and open the settings menu again and select " Group overrides " Click " Add group override ". Check the due date field. Confirm that its initial value matches the assignment's original due date. Override the due date for g1 with a date 2 days later than the original. Click " Save and enter another overide " Confirm that the group override is saved there is no error message displayed. Override the due date for g2 with a date 3 days later than the original. Click " Save " Confirm that the group overrides for g1 and g2 are displayed in the assignment's group overrides page. Move the override for g1 below the override for g2. Confirm that the operation is successful and you don't get an error message. Refresh the page. Confirm that g1 is still below g2. Move back the override for g1 above the override for g2. Confirm that the operation is successful and you don't get an error message. Refresh the page. Confirm that g1 is still above g2. Delete the group override for g1. Confirm that the group override for g1 gets successfully deleted and that you don't see an error message. Assignment deletion Go back to the course page and turn editing on. Delete the assignment. (You might also have to run cron " php admin/cli/cron.php " to process activity deletion) Confirm that you are able to successfully delete the assignment and that you don't see any error message.
    • Affected Branches:
      MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE
    • Pull Master Branch:
      MDL-58255-master

      Description

      The assign() object is being instantiated with an assign DB record instead of a context object in mod/assign/overrideedit.php and mod/assign/overridedelete.php.

      It works, but still, it's usage is incorrect.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jpataleta Jun Pataleta
              Reporter:
              jpataleta Jun Pataleta
              Peer reviewer:
              Mark Nelson
              Integrator:
              Dan Poltawski
              Tester:
              Ryan Wyllie
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                8/May/17