-
Bug
-
Resolution: Fixed
-
Minor
-
4.1, 4.1.4
If you delete an event monitoring rule that has multiple subscriptions you get the error "Inconsistent courseid - context combination detected".
Steps to reproduce issue
- Set up a Moodle site.
- Add a manger user:
- Create a user account manager1.
- Go to Users > Permissions > Assign system roles, select Manager and add manager1 to this role.
- Create two courses containing a feedback activity (mod_feedback).
- Go to Site administration > Reports > Event monitoring rules.
- By Event monitoring is currently disabled click the Enable link.
- Click Add a new rule:
- Rule name: Feedback
- Area to monitor: Feedback
- Event: Response submitted
- Click Save changes.
- Log in as manager1.
- Go to the Preferences page and click the Event monitoring link under Miscellaneous.
- By Select a course select the first course. In the Choose... drop-down list select the feedback activity.
- By Select a course select the second course. In the Choose... drop-down list select the feedback. Under Your current subscriptions there should now be two subscriptions listed.
- Log in as the site admin.
- Enable debugging (Debug messages: DEVELOPER, Display debug messages: Yes).
- Go to Site administration > Reports > Event monitoring rules.
- By the Feedback rule click the Delete rule icon on the right hand side. When the Confirm message appears click Continue.
Expected results
The message "Rule successfully deleted" appears with no error.
Actual results
Inconsistent courseid - context combination detected.
line 267 of /lib/classes/event/base.php: call to debugging()
line 211 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 86 of /admin/tool/monitor/classes/rule.php: call to tool_monitor\rule_manager::delete_rule()
line 96 of /admin/tool/monitor/managerules.php: call to tool_monitor\rule->delete_rule()