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

get_enrolled_users webservice function has invalid return value

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Web Services
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      The get_enrolled_users call is broken in two ways:
      1) It returns $DB->get_records_sql($sql, $params) which is an array of objects. This does not match its specified return value so it always throws this error:

      Error in response - Missing following required key in a single structure: courseid

      2) The return value is incorrectly defined as an external_single_structure so it is not set up to be returning multiple records anyway. Given the purpose of the function, it should be returning multiple user records.

        Attachments

          Activity

            People

            Assignee:
            jerome Jérôme Mouneyrac
            Reporter:
            ashleyholman Ashley Holman
            Tester:
            Nobody
            Participants:
            Component watchers:
            Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              24/Nov/10