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

WS core_course_get_contents should support FEATURE_NO_VIEW_LINK properly

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.7
    • Fix Version/s: 3.8
    • Component/s: Web Services
    • Labels:
    • Testing Instructions:
      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
    • Affected Branches:
      MOODLE_37_STABLE
    • Fixed Branches:
      MOODLE_38_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-65969-master

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jleyva Juan Leyva
              Reporter:
              jleyva Juan Leyva
              Peer reviewer:
              Dani Palou
              Integrator:
              Adrian Greeve
              Tester:
              Janelle Barcega
              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:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                18/Nov/19

                  Time Tracking

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