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

WS core_course_get_contents should support FEATURE_NO_VIEW_LINK properly

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.8
    • 3.7
    • Web Services
    • MOODLE_37_STABLE
    • MOODLE_38_STABLE
    • MDL-65969-master
    • Hide
      1. As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      2. Create a new course with just one section and within the course the following modules: forum, label and page
      3. Enrol one user as student in the course
      4. Create a Token in the mobile app service for the user
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      5. 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 'courseid=2&wsfunction=core_course_get_contents&wstoken=3af67232a7596ceb658df4db329e5ad6' --compressed | python -m "json.tool"

      6. Check that in the response for the module type "label" the field "noviewlink" is set to true and the "description" field is not empty
      7. For the rest of the modules "noviewlink" should be set to false and there won't be a "description" field
      Show
      As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings Create a new course with just one section and within the course the following modules: forum, label and page Enrol one user as student in the course Create a Token in the mobile app service for the user 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 'courseid=2&wsfunction=core_course_get_contents&wstoken=3af67232a7596ceb658df4db329e5ad6' --compressed | python -m "json.tool" Check that in the response for the module type "label" the field "noviewlink" is set to true and the "description" field is not empty For the rest of the modules "noviewlink" should be set to false and there won't be a "description" field

      Right now there is a hardcoded =='label' there to return the description or not.

      We should implement it in a different "generic" view so other plugins similar to label behaves the same.

      My proposed solution is:

      • Return always the module description for plugins with FEATURE_NO_VIEW_LINK set to true
      • Return the different features supported by each type of plugin.

            jleyva Juan Leyva
            jleyva Juan Leyva
            Dani Palou Dani Palou
            Adrian Greeve Adrian Greeve
            Janelle Barcega Janelle Barcega
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 45 minutes
                1h 45m

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