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

Ajax service should clean the return values of the external functions

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Navigate through the template library, and confirm that it works as it used to (view templates, filter templates, etc...)
      2. Edit the file admin/tool/templatelibrary/classes/external.php
      3. Change the return structure of list_templates_returns, and set it to PARAM_INT
      4. Confirm that when you try to list templates you get "Invalid response value detected"
      Show
      Navigate through the template library, and confirm that it works as it used to (view templates, filter templates, etc...) Edit the file admin/tool/templatelibrary/classes/external.php Change the return structure of list_templates_returns , and set it to PARAM_INT Confirm that when you try to list templates you get "Invalid response value detected"
    • Affected Branches:
      MOODLE_29_STABLE
    • Fixed Branches:
      MOODLE_31_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-51700-master

      Description

      I noticed that because my Javascript was strictly checking for an int but the return value was a string. I could fix my external function but it seems appropriate to force Ajax to clean the value, just the same way REST does it.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  23/May/16