Skip to content

Commit

Permalink
web service MDL-22977 REST server return a "required" error on option…
Browse files Browse the repository at this point in the history
…al value
  • Loading branch information
mouneyrac committed Jun 29, 2010
1 parent b738d41 commit 82ff8eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions webservice/rest/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ protected function parse_request() {

$this->functionname = isset($_REQUEST['wsfunction']) ? $_REQUEST['wsfunction'] : null;
unset($_REQUEST['wsfunction']);

$this->parameters = $_REQUEST;
}
}
Expand Down Expand Up @@ -151,7 +151,7 @@ protected static function xmlize_result($returns, $desc) {
$single = '<SINGLE>'."\n";
foreach ($desc->keys as $key=>$subdesc) {
if (!array_key_exists($key, $returns)) {
if ($subdesc->required) {
if ($subdesc->required == VALUE_REQUIRED) {
$single .= '<ERROR>Missing required key "'.$key.'"</ERROR>';
continue;
} else {
Expand Down

0 comments on commit 82ff8eb

Please sign in to comment.