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

Return current site theme in the core_get_site_info WS

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.6.2
    • Fix Version/s: 3.7
    • Component/s: Web Services
    • Labels:
    • Testing Instructions:
      Hide
      1. As admin check that Administration -> Appearance -> Themes -> Theme settings, "Allow user themes" is disabled
      2. Enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      3. Create a Token in the mobile app service for any user in the site (not an admin account)
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      4. Open the console an execute this new curl request, replacing wstoken with the token you just created and the site url with yours.

        curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=core_webservice_get_site_info&wstoken=3af67232a7596ceb658df4db329e5ad6' | python -m "json.tool"

      5. And confirm that in the CURL response, the theme field is "boost" (or the configured default theme for your Moodle installation)
      6. Go to Administration -> Appearance -> Themes -> Theme settings, and enable "Allow user themes"
      7. Edit the profile of the user you used for creating the wstoken and select a different theme than the site one (for example, you can choose "clean" if the site theme is "boos"t)
      8. Execute again the curl request and check that you now receive in the "theme "field the name of the theme you set in the user profile
      Show
      As admin check that Administration -> Appearance -> Themes -> Theme settings, "Allow user themes" is disabled Enable "Mobile services": Site administration ► Mobile app ► Mobile settings Create a Token in the mobile app service for any user in the site (not an admin account) Click on Site administration ► Plugins ► Web services ► Manage tokens Open the console an execute this new curl request, replacing wstoken with the token you just created and the site url with yours. curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=core_webservice_get_site_info&wstoken=3af67232a7596ceb658df4db329e5ad6' | python -m "json.tool" And confirm that in the CURL response, the theme field is "boost" (or the configured default theme for your Moodle installation) Go to Administration -> Appearance -> Themes -> Theme settings, and enable "Allow user themes" Edit the profile of the user you used for creating the wstoken and select a different theme than the site one (for example, you can choose "clean" if the site theme is "boos"t) Execute again the curl request and check that you now receive in the "theme "field the name of the theme you set in the user profile
    • Affected Branches:
      MOODLE_36_STABLE
    • Fixed Branches:
      MOODLE_37_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-64653-master

      Description

      We need to retrieve the active user theme in the site.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                20/May/19

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour
                1h