Opened 4 years ago
Closed 4 years ago
#1298 closed Defect (fixed)
REST api: method parameters
| Reported by: | philout | Owned by: | |
|---|---|---|---|
| Priority: | critical | Milestone: | Elgg 1.7 |
| Component: | Core | Version: | 1.6 |
| Severity: | blocker | Keywords: | |
| Cc: | brettp | Difficulty: |
Description
in engine/lib/api.php:execute_method() line 480:
| " |
to "(!isset($parameters[$key])) &&"
because
if (no_parameter &&
parameter(required))
then throw APIException
Change History (2)
comment:1 Changed 4 years ago by cash
comment:2 Changed 4 years ago by cash
- Resolution set to fixed
- Status changed from new to closed
Fixed in [svn:3562]
Note: See
TracTickets for help on using
tickets.

Here is my fix:
// Check that the variable is present in the request if required $is_param_required = !isset($value['required']) || $value['required']; if ($is_param_required && !array_key_exists($key, $parameters)) throw new APIException(sprintf(elgg_echo('APIException:MissingParameterInMethod'), $key, $method));