{"record":{"id":"b092ea227413a475","repo":"getgrav/grav","slug":"invalid-argument-key","errorCode":null,"errorMessage":"Invalid argument $key.","messagePattern":"Invalid argument \\$key\\.","errorType":"validation","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"system/src/Grav/Common/Page/Collection.php","lineNumber":230,"sourceCode":"        return $list;\n    }\n\n    /**\n     * Remove item from the list.\n     *\n     * @param PageInterface|string|null $key\n     * @return $this\n     * @throws InvalidArgumentException\n     */\n    public function remove($key = null)\n    {\n        if ($key instanceof PageInterface) {\n            $key = $key->path();\n        } elseif (null === $key) {\n            $key = (string)key($this->items);\n        }\n        if (!is_string($key)) {\n            throw new InvalidArgumentException('Invalid argument $key.');\n        }\n\n        parent::remove($key);\n\n        return $this;\n    }\n\n    /**\n     * Reorder collection.\n     *\n     * @param string $by\n     * @param string $dir\n     * @param array|null  $manual\n     * @param string|null $sort_flags\n     * @return $this\n     */\n    public function order($by, $dir = 'asc', $manual = null, $sort_flags = null)\n    {","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/getgrav/grav/blob/6040efed04efa69b8209448ed81308e7c24147c2/system/src/Grav/Common/Page/Collection.php#L212-L248","documentation":"Error \"Invalid argument $key.\" thrown in getgrav/grav.","triggerScenarios":"Thrown at system/src/Grav/Common/Page/Collection.php:230 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6040efed04efa69b8209448ed81308e7c24147c2","analyzedAt":"2026-08-17T05:07:31.593Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}