Skip to content

Commit

Permalink
MDL-82342 core_course: deprecate old course edit webservices
Browse files Browse the repository at this point in the history
Both core_course_edit_section and core_course_edit_module are not needed
anymore. All course edit actions are now executed as state actions from
core_courseformat_update_course.
  • Loading branch information
ferranrecio committed Nov 4, 2024
1 parent 3a1f137 commit c7e7ae1
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 8 deletions.
8 changes: 8 additions & 0 deletions .upgradenotes/MDL-82342-2024110403441284.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
issueNumber: MDL-82342
notes:
core_course:
- message: >-
The core_course_edit_module and core_course_edit_section external
functions are now deprecated. Use core_courseformat_update_course
instead
type: deprecated
36 changes: 30 additions & 6 deletions course/externallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -3621,10 +3621,20 @@ public static function get_updates_since_returns() {
return self::check_updates_returns();
}

/**
* Mark the edit_module as deprecated.
* @todo Remove this method in Moodle 6.0 (MDL-83530).
* @return bool
*/
public static function edit_module_is_deprecated() {
return true;
}

/**
* Parameters for function edit_module()
*
* @since Moodle 3.3
* @deprecated since 5.0
* @todo Remove this method in Moodle 6.0 (MDL-83530).
* @return external_function_parameters
*/
public static function edit_module_parameters() {
Expand All @@ -3647,7 +3657,8 @@ public static function edit_module_parameters() {
*
* Throws exception if operation is not permitted/possible
*
* @since Moodle 3.3
* @deprecated since 5.0
* @todo Remove this method in Moodle 6.0 (MDL-83530).
* @param string $action
* @param int $id
* @param null|int $sectionreturn
Expand Down Expand Up @@ -3753,7 +3764,8 @@ public static function edit_module($action, $id, $sectionreturn = null) {
/**
* Return structure for edit_module()
*
* @since Moodle 3.3
* @deprecated since 5.0
* @todo Remove this method in Moodle 6.0 (MDL-83530).
* @return \core_external\external_description
*/
public static function edit_module_returns() {
Expand Down Expand Up @@ -3826,10 +3838,20 @@ public static function get_module_returns() {
return new external_value(PARAM_RAW, 'html to replace the current module with');
}

/**
* Mark the edit_section as deprecated.
* @todo Remove this method in Moodle 6.0 (MDL-83530).
* @return bool
*/
public static function edit_section_is_deprecated() {
return true;
}

/**
* Parameters for function edit_section()
*
* @since Moodle 3.3
* @deprecated since 5.0
* @todo Remove this method in Moodle 6.0 (MDL-83530).
* @return external_function_parameters
*/
public static function edit_section_parameters() {
Expand All @@ -3844,7 +3866,8 @@ public static function edit_section_parameters() {
/**
* Performs one of the edit section actions
*
* @since Moodle 3.3
* @deprecated since 5.0
* @todo Remove this method in Moodle 6.0 (MDL-83530).
* @param string $action
* @param int $id section id
* @param int $sectionreturn section to return to
Expand Down Expand Up @@ -3874,7 +3897,8 @@ public static function edit_section($action, $id, $sectionreturn) {
/**
* Return structure for edit_section()
*
* @since Moodle 3.3
* @deprecated since 5.0
* @todo Remove this method in Moodle 6.0 (MDL-83530).
* @return \core_external\external_description
*/
public static function edit_section_returns() {
Expand Down
8 changes: 6 additions & 2 deletions lib/db/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -610,15 +610,19 @@
'classname' => 'core_course_external',
'methodname' => 'edit_module',
'classpath' => 'course/externallib.php',
'description' => 'Performs an action on course module (change visibility, duplicate, delete, etc.)',
'description' => '** DEPRECATED ** Please do not call this function any more (will be removed in Moodle 6.0).'
.' Performs an action on course module (change visibility, duplicate, delete, etc.)'
.' Use core_courseformat_update_course instead.',
'type' => 'write',
'ajax' => true,
),
'core_course_edit_section' => array(
'classname' => 'core_course_external',
'methodname' => 'edit_section',
'classpath' => 'course/externallib.php',
'description' => 'Performs an action on course section (change visibility, set marker, delete)',
'description' => '** DEPRECATED ** Please do not call this function any more (will be removed in Moodle 6.0).'
.'Performs an action on course section (change visibility, set marker, delete)'
.' Use core_courseformat_update_course instead.',
'type' => 'write',
'ajax' => true,
),
Expand Down

0 comments on commit c7e7ae1

Please sign in to comment.