Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mackensen committed Dec 6, 2024
1 parent ada0f82 commit 8e09e83
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions classes/manage.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static function add_instance($params) {
$fields = $params['params'];

// Verify the course.
$course = $DB->get_record('course', array('id'=>$fields['courseid']), '*', MUST_EXIST);
$course = $DB->get_record('course', ['id '=> $fields['courseid']], '*', MUST_EXIST);

$plugin = enrol_get_plugin('manual');

Expand All @@ -62,4 +62,4 @@ public static function add_instance($params) {
$enrolid = $plugin->add_instance($course, $fields);
return $enrolid;
}
}
}
2 changes: 1 addition & 1 deletion db/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
defined('MOODLE_INTERNAL') || die();

$functions = [
'local_ws_enrol_manual_add_instance' => [
'local_ws_enrol_manual_add_instance' => [
'classname' => 'local_ws_enrol_manual_external',
'methodname' => 'add_instance',
'classpath' => 'local/ws_enrol_manual/externallib.php',
Expand Down
9 changes: 6 additions & 3 deletions externallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

use core_external\external_api;
use core_external\external_function_parameters;
use core_external\external_single_structure;
Expand Down Expand Up @@ -71,11 +69,16 @@ public static function add_instance($params) {
];
}

/**
* Returns description of add_instance_returns() result value.
*
* @return \external_description
*/
public static function add_instance_returns() {
return new external_single_structure(
[
'id' => new external_value(PARAM_INT, 'id of the created instance')
]
]
);
}
}
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@

$plugin->version = 2024120601; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2023100400; // Requires this Moodle version.
$plugin->component = 'local_ws_enrol_manual'; // Full name of the plugin (used for diagnostics).
$plugin->component = 'local_ws_enrol_manual'; // Full name of the plugin (used for diagnostics).

0 comments on commit 8e09e83

Please sign in to comment.