XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: Critical Critical
    • 2.3
    • 2.3
    • Course, Web Services
    • None
    • MOODLE_23_STABLE
    • MOODLE_23_STABLE
    • Hide

      General setup

      a) Create on second level category hidden with a not hidden sub category. The web service function should not return the hidden category, neither its sub category. Try again with a user having the capability 'moodle/category:viewhiddencategories', the function should return both categories.
      b) Create a third level category with a sub category. Set the max category level of your Moodle to 3. The web service function should return the third level category but not its sub category.
      c) call the web service function as a user having 'moodle/category:manage' capability, the web service function should return all categories (hidden categories and deep level categories).

      Take the REST demo client, then run each function tests:
      https://github.com/moodlehq/sample-ws-clients/blob/master/PHP-REST/client.php

      core_course_get_categories

      /// PARAMETERS

      $params = array('criteria' => array(array('key' => 'visible', 'value' => '1')), 'addsubcategories' => 0);

      'key' => The category column to search, expected keys (value format) are:
      "id" (int) the category id,
      "name" (string) the category name,
      "parent" (int) the parent category id,
      "idnumber" (string) category idnumber,
      "visible" (int) whether the category is visible or not,
      "theme" (string) category theme'),

      core_course_create_categories

      /// PARAMETERS
      $params = array('categories' => array(array('name' => 'newcategory with parent id = 1', 'parent' => '1',
      'idnumber' => 'idnumber123', 'description' => 'description of the category')));

      core_course_update_categories

      /// PARAMETERS

      $params = array('categories' => array(array('id'=>'3','name' => 'category id = 3 move under parent id = 2', 'parent' => '2',
      'idnumber' => 'idnumber1234', 'description' => 'description of the category updated')));

      core_course_delete_categories

      /// PARAMETERS

      $params = array('categories' => array(array('id'=>'3','newparent' => 1)));

      Show
      General setup a) Create on second level category hidden with a not hidden sub category. The web service function should not return the hidden category, neither its sub category. Try again with a user having the capability 'moodle/category:viewhiddencategories', the function should return both categories. b) Create a third level category with a sub category. Set the max category level of your Moodle to 3. The web service function should return the third level category but not its sub category. c) call the web service function as a user having 'moodle/category:manage' capability, the web service function should return all categories (hidden categories and deep level categories). Take the REST demo client, then run each function tests: https://github.com/moodlehq/sample-ws-clients/blob/master/PHP-REST/client.php core_course_get_categories /// PARAMETERS $params = array('criteria' => array(array('key' => 'visible', 'value' => '1')), 'addsubcategories' => 0); 'key' => The category column to search, expected keys (value format) are: "id" (int) the category id, "name" (string) the category name, "parent" (int) the parent category id, "idnumber" (string) category idnumber, "visible" (int) whether the category is visible or not, "theme" (string) category theme'), core_course_create_categories /// PARAMETERS $params = array('categories' => array(array('name' => 'newcategory with parent id = 1', 'parent' => '1', 'idnumber' => 'idnumber123', 'description' => 'description of the category'))); core_course_update_categories /// PARAMETERS $params = array('categories' => array(array('id'=>'3','name' => 'category id = 3 move under parent id = 2', 'parent' => '2', 'idnumber' => 'idnumber1234', 'description' => 'description of the category updated'))); core_course_delete_categories /// PARAMETERS $params = array('categories' => array(array('id'=>'3','newparent' => 1)));

      merge all commits from MDL-30081,MDL-30082,MDL-30083,MDL-30084

            jerome Jérôme Mouneyrac
            jerome Jérôme Mouneyrac
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

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