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

Ajax service should clean the return values of the external functions

    XMLWordPrintable

Details

    • MOODLE_29_STABLE
    • MOODLE_31_STABLE
    • MDL-51700-master
    • 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"

    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

              fred Frédéric Massart
              fred Frédéric Massart
              Damyon Wiese Damyon Wiese
              Dan Poltawski Dan Poltawski
              Dan Poltawski Dan Poltawski
              Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                23/May/16