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() ), ) ); diff --git a/lib/tests/externallib_test.php b/lib/tests/externallib_test.php index 68fb84280d9..ff09d856a18 100644 --- a/lib/tests/externallib_test.php +++ b/lib/tests/externallib_test.php @@ -95,7 +95,8 @@ class externallib_test extends \advanced_testcase { $this->assertSame('666', $result['scalar']); $params = array('text'=>'aaa'); - $description = new \external_function_parameters(array('someid' => new \external_value(PARAM_INT, 'Some int value', false), + $description = new \external_function_parameters(array( + 'someid' => new \external_value(PARAM_INT, 'Some int value', VALUE_DEFAULT), 'text' => new \external_value(PARAM_ALPHA, 'Some text value'))); $result = \external_api::validate_parameters($description, $params); $this->assertCount(2, $result); @@ -105,7 +106,8 @@ class externallib_test extends \advanced_testcase { $this->assertSame('aaa', $result['text']); $params = array('text'=>'aaa'); - $description = new \external_function_parameters(array('someid' => new \external_value(PARAM_INT, 'Some int value', false, 6), + $description = new \external_function_parameters(array( + 'someid' => new \external_value(PARAM_INT, 'Some int value', VALUE_DEFAULT, 6), 'text' => new \external_value(PARAM_ALPHA, 'Some text value'))); $result = \external_api::validate_parameters($description, $params); $this->assertCount(2, $result); diff --git a/mod/page/classes/external.php b/mod/page/classes/external.php index 01566bb0418..76bf14d3696 100644 --- a/mod/page/classes/external.php +++ b/mod/page/classes/external.php @@ -188,7 +188,7 @@ class mod_page_external extends external_api { helper_for_get_mods_by_courses::standard_coursemodule_elements_returns(), [ 'content' => new external_value(PARAM_RAW, 'Page content'), - 'contentformat' => new external_format_value('content', 'Content format'), + 'contentformat' => new external_format_value('content', VALUE_REQUIRED, 'Content format'), 'contentfiles' => new external_files('Files in the content'), 'legacyfiles' => new external_value(PARAM_INT, 'Legacy files flag'), 'legacyfileslast' => new external_value(PARAM_INT, 'Legacy files last control flag'), diff --git a/tag/classes/external.php b/tag/classes/external.php index 6214f86ac02..128023fd94b 100644 --- a/tag/classes/external.php +++ b/tag/classes/external.php @@ -247,7 +247,7 @@ class core_tag_external extends external_api { 'name' => new external_value(PARAM_TAG, 'name'), 'rawname' => new external_value(PARAM_RAW, 'tag raw name (may contain capital letters)'), 'description' => new external_value(PARAM_RAW, 'tag description'), - 'descriptionformat' => new external_format_value(PARAM_INT, 'tag description format'), + 'descriptionformat' => new external_format_value(PARAM_INT, VALUE_REQUIRED, 'tag description format'), 'flag' => new external_value(PARAM_INT, 'flag', VALUE_OPTIONAL), 'official' => new external_value(PARAM_INT, 'whether this flag is standard (deprecated, use isstandard)', VALUE_OPTIONAL),