Skip to content

Commit

Permalink
webservice MDL-21510 added three defines for the description of ws op…
Browse files Browse the repository at this point in the history
…tional 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)
  • Loading branch information
mouneyrac committed Feb 5, 2010
1 parent 382b9ce commit 4b2023d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions webservice/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function detailed_description_html($params) {
$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');
Expand Down Expand Up @@ -335,7 +335,7 @@ public function documentation_html($functions, $printableformat, $activatedproto
$required = get_string('required', 'webservice');
}
if ($paramdesc->required == VALUE_DEFAULT) {
if (empty($paramdesc->default)) {
if ($paramdesc->default === null) {
$default = "null";
} else {
$default = $paramdesc->default;
Expand Down

0 comments on commit 4b2023d

Please sign in to comment.