Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.3
    • Component/s: Course, Web Services
    • Labels:
      None
    • Testing Instructions:
      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)));
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull Master Branch:

      Description

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

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    25/Jun/12