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

Event monitor: Do not allow to edit rule if subscriptions exist

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.8
    • Fix Version/s: 2.8
    • Component/s: Events API
    • Labels:
    • Testing Instructions:
      Hide
      Manual test
      1. Go to Site Administration > Reports > Event monitoring rules.
      2. Add a new rule.
      3. On the event list click on edit icon.
      4. Make sure you're able to select any plugin and event
      5. Go to subscriptions page and subscribe to this rule.
      6. Go to Site Administration > Reports > Event monitoring rules.
      7. Again, click on the edit icon.
      8. Make sure you're NOT able to select any plugin and event
      9. Return to subscription page and unsubscribe of this rule.
      10. Go to Site Administration > Reports > Event monitoring rules.
      11. Again, click on the edit icon.
      12. Make sure you're able to select any plugin and event
      Unit test
      1. Run: vendor/bin/phpunit admin/tool/monitor/tests/subscription_manager_test.php and make sure it pass.
      Show
      Manual test Go to Site Administration > Reports > Event monitoring rules. Add a new rule. On the event list click on edit icon. Make sure you're able to select any plugin and event Go to subscriptions page and subscribe to this rule. Go to Site Administration > Reports > Event monitoring rules. Again, click on the edit icon. Make sure you're NOT able to select any plugin and event Return to subscription page and unsubscribe of this rule. Go to Site Administration > Reports > Event monitoring rules. Again, click on the edit icon. Make sure you're able to select any plugin and event Unit test Run: vendor/bin/phpunit admin/tool/monitor/tests/subscription_manager_test.php and make sure it pass.
    • Affected Branches:
      MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_28_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-47892-master

      Description

      Imagine situation:

      • Rule is created to monitor assignment submission.
      • Teacher subscribed to monitor submission of particular assignment activity.
      • Admin (or another teacher) edits the rule and changes it to minotor forum posts.

      The existing subscriptions will point to the activity of completely different type. They will hopefully break and not work at all.

      We need to lock editing of the most fields in the rule if subscriptions exist. Deleting of the rule should delete all related subscriptions (I hope this is already implemented).

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  10/Nov/14