Merge branch 'MDL-46054-master' of git://github.com/jleyva/moodle

This commit is contained in:
Dan Poltawski 2014-10-06 16:01:26 +01:00
commit fb991204a9
3 changed files with 7 additions and 7 deletions

View File

@ -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()
)
)
);

View File

@ -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)
)
);
}

View File

@ -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) {