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

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

    XMLWordPrintable

Details

    • MOODLE_401_STABLE
    • MDL-76854-subscription_deleted-400
    • 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

      The message "Rule successfully deleted" appears with no error.

      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 The message "Rule successfully deleted" appears with no error.

    Description

      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()

      Attachments

        Activity

          People

            leonstr Leon Stringer
            leonstr Leon Stringer
            David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: