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

modname shouldn't be formatted in WebService block_recentlyaccesseditems_get_recent_items

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 4.1.7, 4.2.4, 4.3.1
    • 4.1.6, 4.2.3, 4.3, 4.4
    • Blocks
    • MOODLE_401_STABLE, MOODLE_402_STABLE, MOODLE_403_STABLE, MOODLE_404_STABLE
    • MOODLE_401_STABLE, MOODLE_402_STABLE, MOODLE_403_STABLE
    • MDL-79816-401
    • MDL-79816-403
    • MDL-79816-main
    • Hide
      1. As admin install the filter_censor plugin.
      2. Access "Settings" of filter "Word censorship": "Site administration > Plugins > Manage filters"
      3. In "Custom bad words list", add the word "ass".
      4. Enable the "Word censorship" plugin and set "Apply to" to "Content and headings":  "Site administration > Plugins > Manage filters".
      5. Enable "Edit Mode" and add the "Recent accessed items" block to the Dashboard: Site administration > Appearance >  Default Dashboard page (if not already present)
      6. Enable web services
      7. Create a user
      8. Create a WS token for the user
      9. Create a course and create an assignment in it.
      10. Enrol user in course as student
      11. Login as the user, access the course and open the assignment.
      12. With this same user, go to Dashboard and check that the assign appears in the recent accessed items block.
      13. Now call the WebService block_recentlyaccesseditems_get_recent_items using this user's token.
      14. Use the following CURL command to test if the webservice works as required. Please note that the `$MOODLE_URL` and `$wstoken` are parameters that need to be filled by you.

        curl '$MOODLE_URL/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=block_recentlyaccesseditems_get_recent_items&wstoken=$wstoken&moodlewssettingfilter=true' --compressed | python -m "json.tool" 

      15. Confirm that the modname of the item is "assign" instead of "**ign", and that the "purpose" and "viewurl" properties are not filtered
      Show
      As admin install the filter_censor plugin . Access "Settings" of filter "Word censorship": "Site administration > Plugins > Manage filters" In "Custom bad words list", add the word "ass". Enable the "Word censorship" plugin and set "Apply to" to "Content and headings":  "Site administration > Plugins > Manage filters". Enable "Edit Mode" and add the "Recent accessed items" block to the Dashboard: Site administration > Appearance >  Default Dashboard page (if not already present) Enable web services Create a user Create a WS token for the user Create a course and create an assignment in it. Enrol user in course as student Login as the user, access the course and open the assignment. With this same user, go to Dashboard and check that the assign appears in the recent accessed items block. Now call the WebService block_recentlyaccesseditems_get_recent_items using this user's token. Use the following CURL command to test if the webservice works as required. Please note that the `$MOODLE_URL` and `$wstoken` are parameters that need to be filled by you. curl '$MOODLE_URL/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=block_recentlyaccesseditems_get_recent_items&wstoken=$wstoken&moodlewssettingfilter=true' --compressed | python -m "json.tool" Confirm that the modname of the item is "assign" instead of "**ign", and that the "purpose" and "viewurl" properties are not filtered

      Filters are applied to modname when IMO it shouldn't, so for example the modname "assign" becomes "**ign" if you have the filter_censor plugin installed. This modname isn't the translated name, it's the name of the plugin so it shouldn't have filters applied.

      How to reproduce:

      1. In a Moodle site, install the filter_censor plugin. In 3.X sites it's part of core. When installing it, add the word "ass" in the list of bad words.
      2. Go to "Site administration > Plugins > Manage filters" and click "Settings" next to "Word censorship".
      3. In "Custom bad words list", add the word "ass".
      4. Back to "Site administration > Plugins > Manage filters", enable the "Word censorship" plugin and set "Apply to" to "Content and headings".
      5. Add the "Recent accessed items" block to the Dashboard.
      6. Create a course and create an assignment inside the course.
      7. With a user enrolled in the course, open the assign.
      8. With this same user, go to Dashboard and check that the assign appears in the recent accessed items block.
      9. Now call the WebService block_recentlyaccesseditems_get_recent_items using this user's token. Check that the modname of the item is "**ign" instead of "assign".

       

            rodrigo.mady@moodle.com Rodrigo Mady
            dpalou Dani Palou
            Paul Holden Paul Holden
            Huong Nguyen Huong Nguyen
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 days, 9 minutes
                2d 9m

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