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

assign::save_user_extension() checks against due date but doesn't support overrides

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.1.6, 4.2.3, 4.3
    • Assignment

      The assign::save_user_extension() method checks that the extension being given is not before the due date but it doesn't take into account overrides.

      The user interface for giving extensions appears to deal with this elsewhere, as extensions can be given correctly in the situation where the default due date is long in the future, but a user has an override to a previous date and we try to give them an extension to a date between the two.

      The method doesn't work as expected when called on its own though (see the unit test in the patch).

      There are actually two separate bugs in the method, but I don't see any point in trying to address them separately:

      1. An assign instance is retrieved without update_effective_access() being called so overrides are ignored
      2. The user id is not passed to assign::get_instance() so the assignment instance is the one for the user giving the extension, not the user receiving the extension

       

            maherne Michael Aherne
            maherne Michael Aherne
            Glyn (Mathew) May Glyn (Mathew) May
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 30 minutes
                2h 30m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.