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

External function core_course_get_contents does not return front page course contents

XMLWordPrintable

    • MOODLE_27_STABLE, MOODLE_28_STABLE
    • MOODLE_27_STABLE, MOODLE_28_STABLE
    • MDL-49174-master
    • 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.

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

            jleyva Juan Leyva
            jleyva Juan Leyva
            Rex Lorenzo Rex Lorenzo
            Andrew Lyons Andrew Lyons
            Adrian Greeve Adrian Greeve
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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