No need to error out if the propery can't be found

Just don't search for it if it is not allowed. But we can still
continue. Webdav will give a 404 if it can't be found later anyway.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2018-03-22 16:50:59 +01:00
commit a292d9402a
No known key found for this signature in database
GPG key ID: F941078878347C0C

View file

@ -112,7 +112,7 @@ class SearchHandler {
}, $xml->orderBy); }, $xml->orderBy);
$select = array_map(function ($propName) use ($allProps) { $select = array_map(function ($propName) use ($allProps) {
if (!isset($allProps[$propName])) { if (!isset($allProps[$propName])) {
throw new BadRequest('requested property is not a valid property for this scope'); return;
} }
$prop = $allProps[$propName]; $prop = $allProps[$propName];
if (!$prop->selectable) { if (!$prop->selectable) {
@ -120,6 +120,7 @@ class SearchHandler {
} }
return $prop; return $prop;
}, $xml->select); }, $xml->select);
$select = array_filter($select);
$where = $this->transformOperator($xml->where, $allProps); $where = $this->transformOperator($xml->where, $allProps);