MDL-82385 course: Return new section fields in core_course_get_contents

This commit is contained in:
Dani Palou
2024-08-14 11:29:24 +02:00
parent a75365f2e4
commit 883448dae4
2 changed files with 13 additions and 0 deletions
@@ -0,0 +1,7 @@
issueNumber: MDL-82385
notes:
core_course:
- message: >-
The external function core_course::get_course_contents now returns the
component and itemid of sections.
type: changed
+6
View File
@@ -212,6 +212,8 @@ class core_course_external extends external_api {
if (!empty($section->availableinfo)) {
$sectionvalues['availabilityinfo'] = \core_availability\info::format_info($section->availableinfo, $course);
}
$sectionvalues['component'] = $section->component;
$sectionvalues['itemid'] = $section->itemid;
$sectioncontents = array();
@@ -447,6 +449,10 @@ class core_course_external extends external_api {
VALUE_OPTIONAL),
'uservisible' => new external_value(PARAM_BOOL, 'Is the section visible for the user?', VALUE_OPTIONAL),
'availabilityinfo' => new external_value(PARAM_RAW, 'Availability information.', VALUE_OPTIONAL),
'component' => new external_value(PARAM_COMPONENT, 'The delegate component of this section if any.',
VALUE_OPTIONAL),
'itemid' => new external_value(PARAM_INT,
'The optional item id delegate component can use to identify its instance.', VALUE_OPTIONAL),
'modules' => new external_multiple_structure(
new external_single_structure(
array(