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

External function core_course_get_contents does not return front page course contents

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.7.5, 2.8.3
    • Fix Version/s: 2.7.6, 2.8.4
    • Component/s: Web Services
    • Labels:
    • Affected Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-49174-master
    • Testing Instructions:
      Hide
      1. In your Moodle front page create a couple of activities (forum) and resources
      2. Enable "Mobile services": Plugins ► Web Services ► External services
      3. Create a Token for the user your are going to test with:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      4. Click add, select user and service (Mobile Service)
      5. Next, you can do a CURL REST call simulating a WS client:
        • You need to replace the wstoken and the URL of your moodle instance

          curl 'http://localhost/m/stable_24/webservice/rest/server.php?moodlewsrestformat=json' -H 'Pragma: no-cache' -H 'Origin: file://' -H 'Accept-Encoding: gzip,deflate,sdch' -H 'Accept-Language: es,en;q=0.8,de-DE;q=0.6,de;q=0.4,nb;q=0.2' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1798.0 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Cache-Control: no-cache' -H 'Connection: keep-alive' --data 'options%5B0%5D%5Bname%5D=&options%5B0%5D%5Bvalue%5D=&courseid=1&wsfunction=core_course_get_contents&wstoken=6137368848c2710566a04917efd5d74d' --compressed
          

      6. Confirm that:
        • You receive a list of course modules including all the activities you created. You may use www.jsonlint.com for validate and view the json returned.
      Show
      In your Moodle front page create a couple of activities (forum) and resources Enable "Mobile services": Plugins ► Web Services ► External services Create a Token for the user your are going to test with: Click on Site administration ► Plugins ► Web services ► Manage tokens Click add, select user and service (Mobile Service) Next, you can do a CURL REST call simulating a WS client: You need to replace the wstoken and the URL of your moodle instance curl 'http://localhost/m/stable_24/webservice/rest/server.php?moodlewsrestformat=json' -H 'Pragma: no-cache' -H 'Origin: file://' -H 'Accept-Encoding: gzip,deflate,sdch' -H 'Accept-Language: es,en;q=0.8,de-DE;q=0.6,de;q=0.4,nb;q=0.2' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1798.0 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Cache-Control: no-cache' -H 'Connection: keep-alive' --data 'options%5B0%5D%5Bname%5D=&options%5B0%5D%5Bvalue%5D=&courseid=1&wsfunction=core_course_get_contents&wstoken=6137368848c2710566a04917efd5d74d' --compressed Confirm that: You receive a list of course modules including all the activities you created. You may use www.jsonlint.com for validate and view the json returned.

      Description

      Due to an small bug in the external function, contents for the front page (course 1) are not returned.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jleyva Juan Leyva
              Reporter:
              jleyva Juan Leyva
              Peer reviewer:
              Rex Lorenzo Rex Lorenzo
              Integrator:
              Andrew Lyons Andrew Lyons
              Tester:
              Adrian Greeve Adrian Greeve
              Participants:
              Component watchers:
              Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                9/Mar/15