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

core_calendar_get_calendar_events is not returning the new categoryid field

    XMLWordPrintable

Details

    • MOODLE_34_STABLE
    • MOODLE_35_STABLE
    • MDL-60836-master
    • Hide
      1. As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      2. Create a new Top category on the site
      3. Create a new course inside that category
      4. Enrol a user as student in that new course
      5. As admin create a category calendar event (for tomorrow) in the new category created in step 2 (via the Calendar block or via the flat menu link).
      6. Now create a site event (for tomorrow)
      7. Create a Token in the mobile app service for the user used in step 4:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      8. Next, you can do a CURL REST call simulating a WS client with the user.
        • You need to replace the wstoken with the token created for the user, courseid with the new course created one and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'options[userevents]=0&options[siteevents]=0&moodlewssettingfilter=true&moodlewssettingfileurl=true&wsfunction=core_calendar_get_calendar_events&wstoken=12a2a65aeea2a177055e233f9e303218&events[courseids][0]=23' --compressed | python -m "json.tool"

      1. Check that you receive the category event created for the new category and that the caterogyid returned matches with the new category created id
      2. Now, remove the following from the curl request "options[userevents]=0&options[siteevents]=0&" and execute the request again
      3. Check that you also receive the Site event and that the categoryid field is set to 0
      Show
      As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings Create a new Top category on the site Create a new course inside that category Enrol a user as student in that new course As admin create a category calendar event (for tomorrow) in the new category created in step 2 (via the Calendar block or via the flat menu link). Now create a site event (for tomorrow) Create a Token in the mobile app service for the user used in step 4: Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client with the user. You need to replace the wstoken with the token created for the user, courseid with the new course created one and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'options [userevents] =0&options [siteevents] =0&moodlewssettingfilter=true&moodlewssettingfileurl=true&wsfunction=core_calendar_get_calendar_events&wstoken=12a2a65aeea2a177055e233f9e303218&events [courseids] [0] =23' --compressed | python -m "json.tool" Check that you receive the category event created for the new category and that the caterogyid returned matches with the new category created id Now, remove the following from the curl request "options [userevents] =0&options [siteevents] =0&" and execute the request again Check that you also receive the Site event and that the categoryid field is set to 0

    Description

      There is a new field in the event table that is not being returned by the existing Web Service.

      We need this field to be able to filter events correctly in the app

      Attachments

        Issue Links

          Activity

            People

              jleyva Juan Leyva
              jleyva Juan Leyva
              Simey Lameze Simey Lameze
              David Monllaó David Monllaó
              Gladys Basiana Gladys Basiana
              David Woloszyn, Huong Nguyen, Jake Dallimore, Michael Hawkins, Stevani Andolo, Juan Leyva, David Woloszyn, Huong Nguyen, Jake Dallimore, Michael Hawkins, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                17/May/18