Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-5018

Fix for failure to create new slot with conflicting slots

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.6.2
    • 2.7
    • Module: Scheduler
    • None
    • 2.5.1 (2013092702)
    • MOODLE_26_STABLE
    • MOODLE_27_STABLE

    Description

      In Scheduler plugin, when a user created a new slot, and that slot conflicted with an existing slot, both would disappear.

      Fix inserts slot after after deleting conflicting ones.

      — a/mod/scheduler/teacherview.controller.php
      +++ b/mod/scheduler/teacherview.controller.php
      @@ -89,6 +89,8 @@ function scheduler_action_doaddsession($scheduler, $formdata) {
      foreach ($conflicts as $conflict)

      { scheduler_delete_slot($conflict->id); }

      + $DB->insert_record('scheduler_slots', $slot, false, true);
      + $countslots++;
      }
      } else {
      $DB->insert_record('scheduler_slots', $slot, false, true);

      TEST:

      • Create new scheduler activity
      • Using "Add Slots" create a slot (slot 1).
      • Using "Add Slots" to create a conflicting (same time and date) slot, ticking the "Force when overlap" (slot 2)
        Without patch (current):
      • Slot 1 and Slot 2 both disappear
        With patch (expected):
      • The Slot 1 is deleted and Slot 2 is created.

      Attachments

        Activity

          People

            bostelm Henning Bostelmann
            hugh2323 Lloyd Powell
            Valery Fremaux
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              12/May/14