{"record":{"id":"658fd1cdff6828d8","repo":"passbolt/passbolt_api","slug":"0-is-not-a-valid-group-id-for-filter-1","errorCode":null,"errorMessage":"\"{0}\" is not a valid group id for filter {1}.","messagePattern":"\"(.+?)\" is not a valid group id for filter (.+?)\\.","errorType":"validation","errorClass":"CakeException","httpStatus":400,"severity":"error","filePath":"src/Controller/Component/QueryStringComponent.php","lineNumber":591,"sourceCode":"\n        return true;\n    }\n\n    /**\n     * Validate a filter that is a single group id\n     * Examples:\n     * - Bueno: '98c2bef5-cd5f-59e7-a1a7-0107c9a7cf08'\n     * - No Bueno: 'no-bueno'\n     *\n     * @param mixed $groupId Value to check.\n     * @param string $filterName name of filters\n     * @throw CakeException if the filter is not valid\n     * @return bool if validate\n     */\n    public static function validateFilterGroup(mixed $groupId, string $filterName): bool\n    {\n        if (!Validation::uuid($groupId)) {\n            throw new CakeException(\n                __('\"{0}\" is not a valid group id for filter {1}.', $groupId, $filterName)\n            );\n        }\n\n        return true;\n    }\n\n    /**\n     * Validate a filter that is a single parent id\n     * Examples:\n     * - Bueno: '98c2bef5-cd5f-59e7-a1a7-0107c9a7cf08'\n     * - Bueno: false\n     * - No Bueno: 'no-bueno'\n     *\n     * @param string|false $parentId uuid\n     * @param string $filtername name of filters\n     * @throw Exception if the filter is not valid\n     * @return bool if validate","sourceCodeStart":573,"sourceCodeEnd":609,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/src/Controller/Component/QueryStringComponent.php#L573-L609","documentation":"Thrown by QueryStringComponent::validateFilterGroup when a single group id fails Cake\\Validation::uuid(). This method is called both directly by validateFilters and per-entry by validateFilterGroups, so it fires whenever any group id in a group filter is not a well-formed UUID.","triggerScenarios":"GET /resources?filter[has-groups][]=marketing (a group name instead of id), a truncated/dashed-stripped UUID, or any non-UUID string under an otherwise valid list filter.","commonSituations":"Clients pass group names or slugs; ids come from another system with different formats; copy-paste truncation; legacy integrations using numeric ids.","solutions":["Replace the value with the group's UUID (look it up via GET /groups).","Validate each id with \\Cake\\Validation\\Validation::uuid() before sending.","Check that ids were not transformed (dashes stripped, uppercased prefixes added, truncated) upstream.","Update legacy clients to UUID identifiers."],"exampleFix":"// before\nGET /resources?filter[has-groups][]=marketing-team\n// after\nGET /resources?filter[has-groups][]=98c2bef5-cd5f-59e7-a1a7-0107c9a7cf08","handlingStrategy":"validation","validationCode":"use Cake\\Validation\\Validation;\nif (!Validation::uuid($groupId)) {\n    throw new \\InvalidArgumentException(\"Not a valid group UUID: \" . var_export($groupId, true));\n}","typeGuard":"function isGroupUuid(mixed $v): bool {\n    return is_string($v) && \\Cake\\Validation\\Validation::uuid($v);\n}","tryCatchPattern":"try {\n    $ok = QueryStringComponent::validateFilterGroup($groupId, $filterName);\n} catch (\\Cake\\Core\\Exception\\CakeException $e) {\n    if (str_contains($e->getMessage(), 'is not a valid group id')) {\n        return $this->response->withStatus(400, 'Group filters require UUID ids');\n    }\n    throw $e;\n}","preventionTips":["Resolve group names to UUIDs via GET /groups before filtering.","Validate group ids with Validation::uuid() at the client boundary.","Keep ids intact end-to-end; beware dash-stripping or truncating transformations."],"tags":["validation","uuid","query-string","group","filter"],"backgroundTag":"invalid-identifier-format","analyzedSha":"31c1bbc10f32808a607fa9bd81891e898779c0bc","analyzedAt":"2026-09-17T00:04:38.960Z","contentChangedAt":"2026-09-17T00:04:38.960Z","schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}