{"record":{"id":"73c722282cde0432","repo":"nextcloud/server","slug":"at-least-one-http-nextcloud-com-ns-prop-filter-o","errorCode":null,"errorMessage":"At least one{http://nextcloud.com/ns}prop-filter or {http://nextcloud.com/ns}param-filter is required for this request","messagePattern":"At least one(.+?)prop-filter or (.+?)param-filter is required for this request","errorType":"http","errorClass":"Sabre\\DAV\\Exception\\BadRequest","httpStatus":400,"severity":"error","filePath":"apps/dav/lib/CalDAV/Search/Xml/Request/CalendarSearchReport.php","lineNumber":145,"sourceCode":"\t\t\t}\n\t\t}\n\n\t\tif (empty($newProps['filters'])) {\n\t\t\tthrow new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}filter element is required for this request');\n\t\t}\n\n\t\t$propsOrParamsDefined = (!empty($newProps['filters']['props']) || !empty($newProps['filters']['params']));\n\t\t$noCompsDefined = empty($newProps['filters']['comps']);\n\t\tif ($propsOrParamsDefined && $noCompsDefined) {\n\t\t\tthrow new BadRequest('{' . SearchPlugin::NS_Nextcloud . '}prop-filter or {' . SearchPlugin::NS_Nextcloud . '}param-filter given without any {' . SearchPlugin::NS_Nextcloud . '}comp-filter');\n\t\t}\n\n\t\tif (!isset($newProps['filters']['search-term'])) {\n\t\t\tthrow new BadRequest('{' . SearchPlugin::NS_Nextcloud . '}search-term is required for this request');\n\t\t}\n\n\t\tif (empty($newProps['filters']['props']) && empty($newProps['filters']['params'])) {\n\t\t\tthrow new BadRequest('At least one{' . SearchPlugin::NS_Nextcloud . '}prop-filter or {' . SearchPlugin::NS_Nextcloud . '}param-filter is required for this request');\n\t\t}\n\n\t\t$obj = new self();\n\t\tforeach ($newProps as $key => $value) {\n\t\t\t$obj->$key = $value;\n\t\t}\n\t\treturn $obj;\n\t}\n}\n","sourceCodeStart":127,"sourceCodeEnd":155,"githubUrl":"https://github.com/nextcloud/server/blob/ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3/apps/dav/lib/CalDAV/Search/Xml/Request/CalendarSearchReport.php#L127-L155","documentation":"Final structural check in CalendarSearchReport::xmlDeserialize(): the filter carries a search-term (and maybe comp-filters) but neither prop-filters nor param-filters, so there is no property to run the substring search against and the server throws Sabre\\DAV\\Exception\\BadRequest (HTTP 400). At least one prop-filter or param-filter must restrict which property is searched.","triggerScenarios":"Sending <n:filter><n:comp-filter name=\"VEVENT\"/><n:search-term>x</n:search-term></n:filter> with no <n:prop-filter> or <n:param-filter>.","commonSituations":"Users expecting a global full-text search over all fields; search UIs that make the property picker optional; payloads trimmed down during debugging.","solutions":["Add at least one prop-filter, commonly <n:prop-filter name=\"SUMMARY\"/>","Expose multiple prop-filters (SUMMARY, DESCRIPTION, LOCATION, ATTENDEE) in the UI if users expect broad search","Client-side, validate that count(props)+count(params) >= 1 before sending"],"exampleFix":"// before\n<n:filter>\n  <n:comp-filter name=\"VEVENT\"/>\n  <n:search-term>meeting</n:search-term>\n</n:filter>\n\n// after\n<n:filter>\n  <n:comp-filter name=\"VEVENT\"/>\n  <n:prop-filter name=\"SUMMARY\"/>\n  <n:search-term>meeting</n:search-term>\n</n:filter>","handlingStrategy":"validation","validationCode":"if ($props === [] && $params === []) {\n    $props = ['SUMMARY']; // search-report requires at least one prop- or param-filter\n}","typeGuard":"function hasAtLeastOnePropOrParamFilter(array $props, array $params): bool {\n    return $props !== [] || $params !== [];\n}","tryCatchPattern":"try {\n    $client->request('REPORT', $calendarUri, $xmlBody);\n} catch (\\Sabre\\Http\\ClientException $e) {\n    if ($e->getResponse()?->getStatus() === 400) { /* add <n:prop-filter name=\"SUMMARY\"/> */ }\n}","preventionTips":["Offer a broad-search preset emitting prop-filters for SUMMARY, DESCRIPTION and LOCATION","Treat search-term alone as an invalid request in client validation","Re-test after server upgrades; the report schema has grown stricter over versions"],"tags":["caldav","xml","search","nextcloud","bad-request","prop-filter"],"backgroundTag":"webdav-400-bad-request","analyzedSha":"ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3","analyzedAt":"2026-08-17T01:36:13.386Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}