{"record":{"id":"e4960905560468e2","repo":"getgrav/grav","slug":"failed-cannot-set-page-parent-to-a-child-of-curre","errorCode":null,"errorMessage":"Failed: Cannot set page parent to a child of current page","messagePattern":"Failed: Cannot set page parent to a child of current page","errorType":"validation","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"system/src/Grav/Common/Page/Page.php","lineNumber":1417,"sourceCode":"     * You need to call $this->save() in order to perform the move.\n     *\n     * @param PageInterface $parent New parent page.\n     * @return $this\n     */\n    public function move(PageInterface $parent)\n    {\n        if (!$this->_original) {\n            $clone = clone $this;\n            $this->_original = $clone;\n        }\n\n        $this->_action = 'move';\n\n        if ($this->route() === $parent->route()) {\n            throw new RuntimeException('Failed: Cannot set page parent to self');\n        }\n        if (Utils::startsWith($parent->rawRoute(), $this->rawRoute())) {\n            throw new RuntimeException('Failed: Cannot set page parent to a child of current page');\n        }\n\n        $this->parent($parent);\n        $this->id(time() . md5((string) $this->filePath()));\n\n        if ($parent->path()) {\n            $this->path($parent->path() . '/' . $this->folder());\n        }\n\n        if ($parent->route()) {\n            $this->route($parent->route() . '/' . $this->slug());\n        } else {\n            $this->route(Grav::instance()['pages']->root()->route() . '/' . $this->slug());\n        }\n\n        $this->raw_route = null;\n\n        return $this;","sourceCodeStart":1399,"sourceCodeEnd":1435,"githubUrl":"https://github.com/getgrav/grav/blob/6040efed04efa69b8209448ed81308e7c24147c2/system/src/Grav/Common/Page/Page.php#L1399-L1435","documentation":"Error \"Failed: Cannot set page parent to a child of current page\" thrown in getgrav/grav.","triggerScenarios":"Thrown at system/src/Grav/Common/Page/Page.php:1417 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"}