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

core_enrol_get_users_courses() throws a require_login_exception exception

    XMLWordPrintable

    Details

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jerome Jérôme Mouneyrac
              Reporter:
              cfulton Charles Fulton
              Peer reviewer:
              Adrian Greeve
              Participants:
              Component watchers:
              Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: