diff --git a/lib/classes/grades_external.php b/lib/classes/grades_external.php index 0c58ce7a3ce..5781accbe3c 100644 --- a/lib/classes/grades_external.php +++ b/lib/classes/grades_external.php @@ -405,7 +405,7 @@ class core_grades_external extends external_api { 'str_feedback' => new external_value( PARAM_TEXT, 'A string representation of the feedback from the grader', VALUE_OPTIONAL), ) - ), 'Any student grades to alter', VALUE_OPTIONAL), + ), 'Any student grades to alter', VALUE_DEFAULT, array()), 'itemdetails' => new external_single_structure( array( 'itemname' => new external_value( @@ -428,7 +428,7 @@ class core_grades_external extends external_api { PARAM_BOOL, 'True if the grade item should be deleted', VALUE_OPTIONAL), 'hidden' => new external_value( PARAM_BOOL, 'True if the grade item is hidden', VALUE_OPTIONAL), - ), 'Any grade item settings to alter', VALUE_OPTIONAL + ), 'Any grade item settings to alter', VALUE_DEFAULT, array() ) ) ); diff --git a/mod/forum/externallib.php b/mod/forum/externallib.php index 98b144cd4f9..4ff0332482e 100644 --- a/mod/forum/externallib.php +++ b/mod/forum/externallib.php @@ -161,8 +161,8 @@ class mod_forum_external extends external_api { array( 'forumids' => new external_multiple_structure(new external_value(PARAM_INT, 'forum ID', '', VALUE_REQUIRED, '', NULL_NOT_ALLOWED), 'Array of Forum IDs', VALUE_REQUIRED), - 'limitfrom' => new external_value(PARAM_INT, 'limit from', VALUE_OPTIONAL, 0), - 'limitnum' => new external_value(PARAM_INT, 'limit number', VALUE_OPTIONAL, 0) + 'limitfrom' => new external_value(PARAM_INT, 'limit from', VALUE_DEFAULT, 0), + 'limitnum' => new external_value(PARAM_INT, 'limit number', VALUE_DEFAULT, 0) ) ); } diff --git a/webservice/lib.php b/webservice/lib.php index 9a867d2fcdb..879c716bd1c 100644 --- a/webservice/lib.php +++ b/webservice/lib.php @@ -1313,9 +1313,9 @@ class '.$classname.' { } } } else if ($keydesc->required == VALUE_OPTIONAL) { - //it does make sens to declare a parameter VALUE_OPTIONAL - //VALUE_OPTIONAL is used only for array/object key - throw new moodle_exception('parametercannotbevalueoptional'); + // It does not make sense to declare a parameter VALUE_OPTIONAL. + // VALUE_OPTIONAL is used only for array/object key. + throw new moodle_exception('erroroptionalparamarray', 'webservice', '', $name); } } else { //for the moment we do not support default for other structure types if ($keydesc->required == VALUE_DEFAULT) {