Moodle
  1. Moodle
  2. MDL-31538

The webservice function core_user_update_user always returns an exception message

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Duplicate
    • Affects Version/s: 2.2.1
    • Fix Version/s: STABLE backlog
    • Component/s: Web Services
    • Labels:
    • Environment:
      Linux, with pt-BR locale
    • Database:
      Any
    • Testing Instructions:
      Hide

      in linux:
      curl -d "wstoken=XXX&wsfunction=core_user_update_users&users[0][id]=ID" http://localhost/moodle/webservice/rest/server.php

      where XXX is yours token number, and ID it's the user id

      Show
      in linux: curl -d "wstoken=XXX&wsfunction=core_user_update_users&users [0] [id] =ID" http://localhost/moodle/webservice/rest/server.php where XXX is yours token number, and ID it's the user id
    • Workaround:
      Hide

      Create a local web service with the correct returns function!

      Show
      Create a local web service with the correct returns function!
    • Affected Branches:
      MOODLE_22_STABLE
    • Rank:
      38091

      Description

      The webservice function "core_user_update_user" always returns an exception message because the return function (update_users_returns() in user/externallib.php) it's not return external_description, it's not following the external API

      I think that all web service functions that not need to return values has this error

        Issue Links

          Activity

          Carlos Alexandre S. da Fonseca created issue -
          Carlos Alexandre S. da Fonseca made changes -
          Field Original Value New Value
          Labels Web Webservice update users
          Hide
          Michael de Raadt added a comment -

          Thanks for reporting that.

          Show
          Michael de Raadt added a comment - Thanks for reporting that.
          Michael de Raadt made changes -
          Fix Version/s STABLE backlog [ 10463 ]
          Labels Web Webservice update users triaged
          Hide
          Jérôme Mouneyrac added a comment -

          If I remember the REST server was fixed recently about the null value. What version do you have? You should have this : https://github.com/moodle/moodle/blob/master/webservice/rest/locallib.php#L88-92

          Show
          Jérôme Mouneyrac added a comment - If I remember the REST server was fixed recently about the null value. What version do you have? You should have this : https://github.com/moodle/moodle/blob/master/webservice/rest/locallib.php#L88-92
          Hide
          Carlos Alexandre S. da Fonseca added a comment -

          2011120501.00, in version.php

          Show
          Carlos Alexandre S. da Fonseca added a comment - 2011120501.00, in version.php
          Hide
          Jérôme Mouneyrac added a comment -

          From the version number it seems you don't have the fix. Can you check that you have the lines mentioned in the previous comment?

          Show
          Jérôme Mouneyrac added a comment - From the version number it seems you don't have the fix. Can you check that you have the lines mentioned in the previous comment?
          Hide
          Carlos Alexandre S. da Fonseca added a comment -

          The version (2011120501.00), dont't have.

          Show
          Carlos Alexandre S. da Fonseca added a comment - The version (2011120501.00), dont't have.
          Hide
          Jérôme Mouneyrac added a comment -

          Hi Carlos,
          you can get update your Moodle site to the last version, or if not possible, you can get the fix from github (https://github.com/moodle/moodle/commit/2ada59b759fc1088e8d5ab7e287bfd8669ab7b23). It will resolve your problem.
          I'm closing the issue as it has been resolved.
          Cheers.

          Show
          Jérôme Mouneyrac added a comment - Hi Carlos, you can get update your Moodle site to the last version, or if not possible, you can get the fix from github ( https://github.com/moodle/moodle/commit/2ada59b759fc1088e8d5ab7e287bfd8669ab7b23 ). It will resolve your problem. I'm closing the issue as it has been resolved. Cheers.
          Jérôme Mouneyrac made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Resolution Duplicate [ 3 ]
          Jérôme Mouneyrac made changes -
          Link This issue duplicates MDL-31077 [ MDL-31077 ]

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: