MDL-49330 webservices: Fix get_course_notes api
authorAnkit Agarwal <ankit@moodle.com>
Thu, 2 Apr 2015 06:04:11 +0000 (11:34 +0530)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Thu, 2 Apr 2015 09:09:25 +0000 (11:09 +0200)
lib/db/services.php
notes/externallib.php
version.php

index 03fc117..0383b29 100644 (file)
@@ -336,6 +336,7 @@ $functions = array(
     'core_notes_get_course_notes' => array(
         'classname'     => 'core_notes_external',
         'methodname'    => 'get_course_notes',
+        'classpath'     => 'notes/externallib.php',
         'description'   => 'Returns all notes in specified course (or site) for the specified user.',
         'type'          => 'read',
         'capabilities'  => 'moodle/notes:view',
index 957a07d..f07defd 100644 (file)
@@ -25,6 +25,7 @@
  */
 
 require_once("$CFG->libdir/externallib.php");
+require_once($CFG->dirroot . "/notes/lib.php");
 
 /**
  * Notes external functions
@@ -73,7 +74,6 @@ class core_notes_external extends external_api {
      */
     public static function create_notes($notes = array()) {
         global $CFG, $DB;
-        require_once($CFG->dirroot . "/notes/lib.php");
 
         $params = self::validate_parameters(self::create_notes_parameters(), array('notes' => $notes));
 
@@ -224,7 +224,6 @@ class core_notes_external extends external_api {
      */
     public static function delete_notes($notes = array()) {
         global $CFG;
-        require_once($CFG->dirroot . "/notes/lib.php");
 
         $params = self::validate_parameters(self::delete_notes_parameters(), array('notes' => $notes));
 
@@ -293,7 +292,6 @@ class core_notes_external extends external_api {
      */
     public static function get_notes($notes) {
         global $CFG;
-        require_once($CFG->dirroot . "/notes/lib.php");
 
         $params = self::validate_parameters(self::get_notes_parameters(), array('notes' => $notes));
         // Check if note system is enabled.
@@ -393,7 +391,6 @@ class core_notes_external extends external_api {
      */
     public static function update_notes($notes = array()) {
         global $CFG, $DB;
-        require_once($CFG->dirroot . "/notes/lib.php");
 
         $params = self::validate_parameters(self::update_notes_parameters(), array('notes' => $notes));
 
index 1681f7f..e328e43 100644 (file)
@@ -29,7 +29,7 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$version  = 2015040100.00;              // YYYYMMDD      = weekly release date of this DEV branch.
+$version  = 2015040100.02;              // YYYYMMDD      = weekly release date of this DEV branch.
                                         //         RR    = release increments - 00 in DEV branches.
                                         //           .XX = incremental changes.