{"record":{"id":"e17dfc7ea1a5cb38","repo":"flarum/framework","slug":"include-must-be-a-string","errorCode":null,"errorMessage":"include must be a string","messagePattern":"include must be a string","errorType":"http","errorClass":"BadRequestException","httpStatus":400,"severity":"error","filePath":"framework/core/src/Http/RequestUtil.php","lineNumber":208,"sourceCode":"        if ($request->getQueryParams()['page']['number'] ?? false) {\n            return self::extractOffsetFromNumber($request, $limit);\n        }\n\n        $offset = (int) ($request->getQueryParams()['page']['offset'] ?? 0);\n\n        if ($offset < 0) {\n            throw new BadRequestException('page[offset] must be at least 0');\n        }\n\n        return $offset;\n    }\n\n    public static function extractInclude(Request $request, ?array $available): array\n    {\n        $include = $request->getQueryParams()['include'] ?? '';\n\n        if (! is_string($include)) {\n            throw new BadRequestException('include must be a string');\n        }\n\n        $includes = array_filter(explode(',', $include));\n\n        $invalid = array_diff($includes, $available);\n\n        if (count($invalid)) {\n            throw new BadRequestException('Invalid includes ['.implode(',', $invalid).']');\n        }\n\n        return $includes;\n    }\n\n    public static function extractFilter(Request $request): array\n    {\n        $filter = $request->getQueryParams()['filter'] ?? [];\n\n        if (! is_array($filter)) {","sourceCodeStart":190,"sourceCodeEnd":226,"githubUrl":"https://github.com/flarum/framework/blob/4b939f685389bfe8a380e9e28ddf305a1c66950c/framework/core/src/Http/RequestUtil.php#L190-L226","documentation":"Guard in RequestUtil::extractInclude: the 'include' query parameter (comma-separated relationship paths for eager loading) must be a plain string. If a client sends ?include[]=foo style array params, the value cannot be split into paths and a 400 BadRequestException is thrown.","triggerScenarios":"Thrown at framework/core/src/Http/RequestUtil.php:208 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Send include as one string: ?include=user,posts.user","Avoid array-style include[] parameters","Fix the client's query builder so it joins include paths with commas"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4b939f685389bfe8a380e9e28ddf305a1c66950c","analyzedAt":"2026-09-15T18:09:20.879Z","contentChangedAt":"2026-09-15T18:09:20.879Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}