true / false filters not applying
rbibby opened this issue · 1 comments
rbibby commented
What is the issue?
When trying to filter on archived
status on the PSS endpoints, the filter is not being applied when using true
and false
. Using true and false as strings (ie. 'true'
& 'false'
) does work.
Steps To Reproduce
Doesn't apply filter:
$filters = [];
$filters['archived'] = true;
$pageNumber = $request->input('page', 1);
$requests = $pssClient->getRequests($pageNumber, 15, $filters);
Does apply filter:
$filters = [];
$filters['archived'] = 'true';
$pageNumber = $request->input('page', 1);
$requests = $pssClient->getRequests($pageNumber, 15, $filters);
Expected behaviour
true
and false
should work in the same way that 'true'
and 'false'
would
rbibby commented
I think this is caused by line 40 of /src/PaginationUrl.php
Running urlencode on a boolean would result in 0 or 1, neither of which are picked up by filtering on the API. It has to be true or false.