Skip to content

Commit

Permalink
[BUGFIX] Avoid warning for invalid filters
Browse files Browse the repository at this point in the history
When an invalid filter is provided, throw the appropriate error and
avoid additional warnings.
  • Loading branch information
Mateu Aguiló Bosch committed Dec 21, 2015
1 parent c5886a3 commit cbcaa48
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Plugin/resource/DataProvider/DataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ public static function processFilterInput($filter, $public_field) {
// filter[foo]=bar would be converted to filter[foo][value] = bar.
$filter = array('value' => $filter);
}
if (!isset($filter['value'])) {
throw new BadRequestException(sprintf('Value not present for the "%s" filter. Please check the URL format.', $public_field));
}
if (!is_array($filter['value'])) {
if (!isset($filter['value'])) {
throw new BadRequestException(sprintf('Value not present for the "%s" filter. Please check the URL format.', $public_field));
}
$filter['value'] = array($filter['value']);
}
// Add the property.
Expand Down

0 comments on commit cbcaa48

Please sign in to comment.