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

Return site policy in tool_mobile_get_config (Backport of MDL-60005)

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. As admin add a sitepolicy global setting on your site pointing to any URL (it may not exists)
      2. As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      3. Create a Token for one normal user:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      4. Next, you can do a CURL REST call simulating a WS client with the user.
        • You need to replace the wstoken, and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=tool_mobile_get_config&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true' | python -m "json.tool"

      5. Check that among all the fields in the curl response (settings field), you receive a field with name sitepolicy and value the URL you used.
      Show
      As admin add a sitepolicy global setting on your site pointing to any URL (it may not exists) As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings Create a Token for one normal user: Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client with the user. You need to replace the wstoken, and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=tool_mobile_get_config&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true' | python -m "json.tool" Check that among all the fields in the curl response (settings field), you receive a field with name sitepolicy and value the URL you used.
    • Affected Branches:
      MOODLE_32_STABLE, MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE, MOODLE_33_STABLE
    • Pull from Repository:

      Description

      This will help to fix a mobile app bug in Moodle 3.3 and 3.2 (MOBILE-2209)

      We need the site policy link to allow the user to accept it when is configured in that way.

      The backport should be very safe because we are not changing the Web Services parameters or return structures (we return a generic array of name/value settings so adding extra settings there is safe)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jleyva Juan Leyva
              Reporter:
              jleyva Juan Leyva
              Peer reviewer:
              David Monllaó
              Integrator:
              Jun Pataleta
              Tester:
              Simey Lameze
              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:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                13/Nov/17