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

core_enrol_get_users_courses() throws a require_login_exception exception

XMLWordPrintable

      I'm building out a webservice that retrieves a given user's courses. I've created an external webservice with the core_enrol_get_users_courses() function, allowed it for authorized users only, assigned a role account to it, and verified that the user has all the required capabilities. When I try to retrieve courses for the passed user id, I get a null return.

      After turning on debugging I find that validate_context() is throwing a require_login_exception exception, which doesn't make any sense to me. I've verified that if I skip the validate_context tests the proper courses would be returned.

            jerome Jérôme Mouneyrac
            cfulton Charles Fulton
            Adrian Greeve Adrian Greeve
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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