webservice MDL-21510 added three defines for the description of ws optional value:
VALUE_REQUIRED - if the parameter is not supplied, there is an error VALUE_OPTIONAL - if the parameter is not supplied, then the param has no value VALUE_DEFAULT - if the parameter is not supplied, then the default value is used (quick fix on default null value)
This commit is contained in:
@@ -52,7 +52,7 @@ class core_webservice_renderer extends plugin_renderer_base {
|
||||
$required = '';
|
||||
}
|
||||
if ($params->required == VALUE_DEFAULT) {
|
||||
if (empty($params->default)) {
|
||||
if ($params->default === null) {
|
||||
$params->default = "null";
|
||||
}
|
||||
$required = html_writer::start_tag('b', array()).get_string('default', 'webservice', $params->default).html_writer::end_tag('b');
|
||||
@@ -335,7 +335,7 @@ EOF;
|
||||
$required = get_string('required', 'webservice');
|
||||
}
|
||||
if ($paramdesc->required == VALUE_DEFAULT) {
|
||||
if (empty($paramdesc->default)) {
|
||||
if ($paramdesc->default === null) {
|
||||
$default = "null";
|
||||
} else {
|
||||
$default = $paramdesc->default;
|
||||
|
||||
Reference in New Issue
Block a user