{"record":{"id":"7ba343eb88a2880e","repo":"getgrav/grav","slug":"cannot-rename-object-key-dst-is-already-take","errorCode":null,"errorMessage":"Cannot rename object: key '{$dst}' is already taken","messagePattern":"Cannot rename object: key '(.+?)' is already taken","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"system/src/Grav/Framework/Flex/Storage/SimpleStorage.php","lineNumber":283,"sourceCode":"        }\n\n        $this->data[$dst] = $this->data[$src];\n\n        return true;\n    }\n\n    /**\n     * {@inheritdoc}\n     * @see FlexStorageInterface::renameRow()\n     */\n    public function renameRow(string $src, string $dst): bool\n    {\n        if (null === $this->data) {\n            $this->buildIndex();\n        }\n\n        if ($this->hasKey($dst)) {\n            throw new RuntimeException(\"Cannot rename object: key '{$dst}' is already taken\");\n        }\n\n        if (!$this->hasKey($src)) {\n            return false;\n        }\n\n        // Change single key in the array without changing the order or value.\n        $keys = array_keys($this->data);\n        $keys[array_search($src, $keys, true)] = $dst;\n\n        $data = array_combine($keys, $this->data);\n        if (false === $data) {\n            throw new LogicException('Bad data');\n        }\n\n        $this->data = $data;\n\n        return true;","sourceCodeStart":265,"sourceCodeEnd":301,"githubUrl":"https://github.com/getgrav/grav/blob/6040efed04efa69b8209448ed81308e7c24147c2/system/src/Grav/Framework/Flex/Storage/SimpleStorage.php#L265-L301","documentation":"Error \"Cannot rename object: key '{$dst}' is already taken\" thrown in getgrav/grav.","triggerScenarios":"Thrown at system/src/Grav/Framework/Flex/Storage/SimpleStorage.php:283 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"}