Advertisement
Guest User

Untitled

a guest
Oct 13th, 2015
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. diff --git a/group/externallib.php b/group/externallib.php
  2. index d7a5a07..b530283 100644
  3. --- a/group/externallib.php
  4. +++ b/group/externallib.php
  5. @@ -1310,7 +1310,7 @@ class core_group_external extends external_api {
  6. return new external_function_parameters(
  7. array(
  8. 'cmid' => new external_value(PARAM_INT, 'course module id'),
  9. - 'userid' => new external_value(PARAM_INT, 'id of user, empty for current user', VALUE_OPTIONAL, 0)
  10. + 'userid' => new external_value(PARAM_INT, 'id of user, empty for current user', VALUE_DEFAULT, 0)
  11. )
  12. );
  13. }
  14. diff --git a/notes/externallib.php b/notes/externallib.php
  15. index 944b2fb..b697bf4 100644
  16. --- a/notes/externallib.php
  17. +++ b/notes/externallib.php
  18. @@ -466,7 +466,7 @@ class core_notes_external extends external_api {
  19. return new external_function_parameters(
  20. array(
  21. 'courseid' => new external_value(PARAM_INT, 'course id, 0 for SITE'),
  22. - 'userid' => new external_value(PARAM_INT, 'user id', VALUE_OPTIONAL),
  23. + 'userid' => new external_value(PARAM_INT, 'user id', VALUE_DEFAULT, 0),
  24. )
  25. );
  26. }
  27. diff --git a/webservice/lib.php b/webservice/lib.php
  28. index 879c716..f7e6a28 100644
  29. --- a/webservice/lib.php
  30. +++ b/webservice/lib.php
  31. @@ -1293,6 +1293,7 @@ class '.$classname.' {
  32. $params = array();
  33. $params_desc = array();
  34. foreach ($function->parameters_desc->keys as $name=>$keydesc) {
  35. + $functiondescription = "$function->classname::$function->methodname $name";
  36. $param = '$'.$name;
  37. $paramanddefault = $param;
  38. //need to generate the default if there is any
  39. @@ -1315,7 +1316,7 @@ class '.$classname.' {
  40. } else if ($keydesc->required == VALUE_OPTIONAL) {
  41. // It does not make sense to declare a parameter VALUE_OPTIONAL.
  42. // VALUE_OPTIONAL is used only for array/object key.
  43. - throw new moodle_exception('erroroptionalparamarray', 'webservice', '', $name);
  44. + throw new moodle_exception('erroroptionalparamarray', 'webservice', '', $functiondescription);
  45. }
  46. } else { //for the moment we do not support default for other structure types
  47. if ($keydesc->required == VALUE_DEFAULT) {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement