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

Filters aren't applied to searchbanner in tool_mobile_get_config WebService

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 4.3.1
    • 4.3
    • Global search
    • MOODLE_403_STABLE
    • MOODLE_403_STABLE
    • MDL-79784-403
    • MDL-79784-master
    • Hide
      1. Log in as admin
      2. Navigate to Plugins > Filters > Manage filters in site administration
      3. Enable Multi-language content
        • Apply to: Content and headings
      4. Go to Administration > Plugins > Search >Manage global search
      5. In the " Search information " text area add the following HTML (in the HTML editor mode)

        <span class="multilang" lang="en">Text (EN)</span><span class="multilang" lang="de">Text (DE)</span>
        

      6. As an admin, enable “Web services for mobile devices” on Site administration ► Advanced features
      7. Create a Token in the mobile app service for any user on the site (not an admin account)
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      8. Open the console and execute this new curl request, replacing WS_TOKEN with the token you just created and the SITE_URL with yours.

        curl ‘SITE_URL/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=tool_mobile_get_config&moodlewssettinglang=en&moodlewssettingfilter=true&wstoken=WS_TOKEN | python -m "json.tool"

      1. Confirm that:
        • In the curl request response you see a field called: searchbanner
        • The content of that field is "<p>Text (EN)<\/p>"
      Show
      Log in as admin Navigate to Plugins > Filters > Manage filters in site administration Enable Multi-language content Apply to: Content and headings Go to Administration > Plugins > Search >Manage global search In the " Search information " text area add the following HTML (in the HTML editor mode) <span class="multilang" lang="en">Text (EN)</span><span class="multilang" lang="de">Text (DE)</span> As an admin, enable “Web services for mobile devices” on Site administration ► Advanced features Create a Token in the mobile app service for any user on the site (not an admin account) Click on Site administration ► Plugins ► Web services ► Manage tokens Open the console and execute this new curl request, replacing WS_TOKEN with the token you just created and the SITE_URL with yours. curl ‘SITE_URL/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=tool_mobile_get_config&moodlewssettinglang=en&moodlewssettingfilter=true&wstoken=WS_TOKEN | python -m "json.tool" Confirm that: In the curl request response you see a field called: searchbanner The content of that field is "<p>Text (EN)<\/p>"

      The WebService tool_mobile_get_config returns the value of $CFG->searchbanner without any filter applied (it doesn't call format_text).

      In LMS, when this value is rendered it's processed using format_text.

      The Moodle app needs this value formatted so filters like glossary links are applied. If we don't want to break the existing API we could add a new field to return the formatted text.

            jleyva Juan Leyva
            dpalou Dani Palou
            Rodrigo Mady Rodrigo Mady
            Huong Nguyen Huong Nguyen
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 13 minutes
                2h 13m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.