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

"Inconsistent courseid - context combination" deleting event monitoring rule with multiple subscriptions

XMLWordPrintable

    • MOODLE_401_STABLE
    • MOODLE_401_STABLE, MOODLE_402_STABLE
    • MDL-76854-subscription_deleted-401
    • MDL-76854-subscription_deleted
    • Hide
      1. Set up a Moodle site.
      2. Add a manger user:
        1. Create a user account manager1.
        2. Go to Users > Permissions > Assign system roles, select Manager and add manager1 to this role.
      3. Create two courses containing a feedback activity (mod_feedback).
      4. Go to Site administration > Reports > Event monitoring rules.
      5. By Event monitoring is currently disabled click the Enable link.
      6. Click Add a new rule:
        1. Rule name: Feedback
        2. Area to monitor: Feedback
        3. Event: Response submitted
        4. Click Save changes.
      7. Log in as manager1.
      8. Go to the Preferences page and click the Event monitoring link under Miscellaneous.
      9. By Select a course select the first course. In the Choose... drop-down list select the feedback activity.
      10. 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.
      11. Log in as the site admin.
      12. Enable debugging (Debug messages: DEVELOPER, Display debug messages: Yes).
      13. Go to Site administration > Reports > Event monitoring rules.
      14. By the Feedback rule click the Delete rule icon on the right hand side. When the Confirm message appears click Continue.

      Expected results

      1. Confirm The message "Rule successfully deleted" appears with no error.
      2. Navigate to Reports > Logs in site administration
      3. Get today's logs
      4. Confirm there are two Event monitor / Subscription events, one for each course (see the Event context column)
      Show
      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 Confirm The message "Rule successfully deleted" appears with no error. Navigate to Reports > Logs in site administration Get today's logs Confirm there are two Event monitor / Subscription events, one for each course (see the Event context column)

      If you delete an event monitoring rule that has multiple subscriptions you get the error "Inconsistent courseid - context combination detected".

      Steps to reproduce issue

      1. Set up a Moodle site.
      2. Add a manger user:
        1. Create a user account manager1.
        2. Go to Users > Permissions > Assign system roles, select Manager and add manager1 to this role.
      3. Create two courses containing a feedback activity (mod_feedback).
      4. Go to Site administration > Reports > Event monitoring rules.
      5. By Event monitoring is currently disabled click the Enable link.
      6. Click Add a new rule:
        1. Rule name: Feedback
        2. Area to monitor: Feedback
        3. Event: Response submitted
        4. Click Save changes.
      7. Log in as manager1.
      8. Go to the Preferences page and click the Event monitoring link under Miscellaneous.
      9. By Select a course select the first course. In the Choose... drop-down list select the feedback activity.
      10. 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.
      11. Log in as the site admin.
      12. Enable debugging (Debug messages: DEVELOPER, Display debug messages: Yes).
      13. Go to Site administration > Reports > Event monitoring rules.
      14. 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()

        1. MDL-76854.png
          623 kB
          Ron Carl Alfon Yu

            leonstr Leon Stringer
            leonstr Leon Stringer
            Paul Holden Paul Holden
            Ilya Tregubov Ilya Tregubov
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

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

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