From bdd3e5efb15cfb4e68306d089b517d61df0f5cd8 Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Wed, 1 Feb 2023 11:32:07 +0800 Subject: [PATCH] MDL-75085 external: Fix external_multiple_structure parameter passing Some calls to the external_multiple_structure's constructor incorrectly pass parameters where the value for the $description parameter is not being passed. This results to invalid values being passed for the $required parameter. --- completion/classes/external.php | 1 + course/externallib.php | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/completion/classes/external.php b/completion/classes/external.php index 6bb4ece1a3a..3dc1af84471 100644 --- a/completion/classes/external.php +++ b/completion/classes/external.php @@ -339,6 +339,7 @@ class core_completion_external extends external_api { ) ] ), + 'Completion status details', VALUE_DEFAULT, [] ), diff --git a/course/externallib.php b/course/externallib.php index 0397a8d9ed1..0a374127f5b 100644 --- a/course/externallib.php +++ b/course/externallib.php @@ -483,6 +483,7 @@ class core_course_external extends external_api { 'dataid' => new external_value(PARAM_NOTAGS, 'cm data id', VALUE_OPTIONAL), ) ), + 'Course dates', VALUE_DEFAULT, [] ), @@ -514,7 +515,7 @@ class core_course_external extends external_api { VALUE_OPTIONAL ), ) - ), VALUE_DEFAULT, array() + ), 'Course contents', VALUE_DEFAULT, array() ), 'contentsinfo' => new external_single_structure( array( @@ -1305,7 +1306,7 @@ class core_course_external extends external_api { 'value' => new external_value(PARAM_RAW, 'the value for the option 1 (yes) or 0 (no)' ) ) - ), VALUE_DEFAULT, array() + ), 'Course duplication options', VALUE_DEFAULT, array() ), ) ); @@ -1532,7 +1533,7 @@ class core_course_external extends external_api { 'value' => new external_value(PARAM_RAW, 'the value for the option 1 (yes) or 0 (no)' ) ) - ), VALUE_DEFAULT, array() + ), 'Course import options', VALUE_DEFAULT, array() ), ) );