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

Event monitor: Deletion of site rules on course deletion (and debugging on rule deletion)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.8
    • Fix Version/s: 2.8
    • Component/s: Events API
    • Labels:
    • Testing Instructions:
      Hide
      Test 1
      1. Create a rule in a course.
      2. Go to delete the rule and check on the confirmation page that there is no message about there being any subscriptions for the rule.
      3. Click cancel.
      4. Subscribe to this rule with a bunch of different users.
      5. Log in as admin and delete the rule.
      6. On the confirmation page ensure that the warning about deleting the rule also contains the number of subscriptions that would be deleted to.
      Test 2
      1. Create a course.
      2. Create a course rule.
      3. Create a site wide rule.
      4. Delete the course and ensure there is no debugging message related to "Inconsistent courseid - context combination detected".
      5. Confirm the course rule no longer exists.
      6. Confirm that the site wide rule still exists.
      Test 3
      1. Run all the unit/behat tests in admin/tool/monitor/tests.
      Show
      Test 1 Create a rule in a course. Go to delete the rule and check on the confirmation page that there is no message about there being any subscriptions for the rule. Click cancel. Subscribe to this rule with a bunch of different users. Log in as admin and delete the rule. On the confirmation page ensure that the warning about deleting the rule also contains the number of subscriptions that would be deleted to. Test 2 Create a course. Create a course rule. Create a site wide rule. Delete the course and ensure there is no debugging message related to "Inconsistent courseid - context combination detected". Confirm the course rule no longer exists. Confirm that the site wide rule still exists. Test 3 Run all the unit/behat tests in admin/tool/monitor/tests.
    • Affected Branches:
      MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_28_STABLE
    • Pull Master Branch:
      MDL-48107_master

      Description

      First of all, I noticed that when I delete the rule I am not warned about the number of existing subscriptions and that they are going also to be deleted.

      Second, I got this debugging:

      Inconsistent courseid - context combination detected.
       
          line 247 of /lib/classes/event/base.php: call to debugging()
          line 198 of /admin/tool/monitor/classes/subscription_manager.php: call to core\event\base::create()
          line 116 of /admin/tool/monitor/classes/rule_manager.php: call to tool_monitor\subscription_manager::remove_all_subscriptions_for_rule()
          line 85 of /admin/tool/monitor/classes/rule.php: call to tool_monitor\rule_manager::delete_rule()
          line 94 of /admin/tool/monitor/managerules.php: call to tool_monitor\rule->delete_rule()
      

        Attachments

          Activity

            People

            Assignee:
            markn Mark Nelson
            Reporter:
            marina Marina Glancy
            Integrator:
            Eloy Lafuente (stronk7)
            Tester:
            Eloy Lafuente (stronk7)
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

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