Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.3
    • Component/s: Course, Web Services
    • Labels:
    • Testing Instructions:
      Hide

      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).

      Use this client:
      https://github.com/moodlehq/sample-ws-clients/blob/master/PHP-REST/client.php

      functionname
      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'),

      Show
      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). Use this client: https://github.com/moodlehq/sample-ws-clients/blob/master/PHP-REST/client.php functionname 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'),
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull from Repository:
      git@github.com:mouneyrac/moodle.git
    • Pull Master Branch:
      MDL-30084-final
    • Rank:
      24715

      Description

      Create web service function core_course_get_categories()

      1. externallib.php.patch
        4 kB
        Fábio Souto
      2. services.php.patch
        0.7 kB
        Fábio Souto
      3. smurf.xml
        8 kB
        Eloy Lafuente (stronk7)

        Issue Links

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: