{"record":{"id":"53f3dd88ef86dd62","repo":"getgrav/grav","slug":"page-s-cannot-be-moved-to-non-existing-path-s","errorCode":null,"errorMessage":"Page /%s cannot be moved to non-existing path %s","messagePattern":"Page /(.+?) cannot be moved to non-existing path (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"system/src/Grav/Common/Flex/Types/Pages/PageObject.php","lineNumber":224,"sourceCode":"\n        // Figure out storage path to the new route.\n        $parentKey = $this->getProperty('parent_key');\n        if ($parentKey !== '') {\n            $parentRoute = $this->getProperty('route');\n\n            // Root page cannot be moved.\n            if ($this->root()) {\n                throw new RuntimeException(sprintf('Root page cannot be moved to %s', $parentRoute));\n            }\n\n            // Make sure page isn't being moved under itself.\n            $key = $this->getStorageKey();\n\n            /** @var PageObject|null $parent */\n            $parent = $parentKey !== false ? $this->getFlexDirectory()->getObject($parentKey, 'storage_key') : null;\n            if (!$parent) {\n                // Page cannot be moved to non-existing location.\n                throw new RuntimeException(sprintf('Page /%s cannot be moved to non-existing path %s', $key, $parentRoute));\n            }\n\n            // TODO: make sure that the page doesn't exist yet if moved/copied.\n        }\n\n        if ($reorder === true && !$this->root()) {\n            $reorder = $this->_reorder;\n        }\n\n        // Force automatic reorder if item is supposed to be added to the last.\n        if (!is_array($reorder) && (int)$this->order() >= 999999) {\n            $reorder = [];\n        }\n\n        // Reorder siblings.\n        $siblings = is_array($reorder) ? ($this->reorderSiblings($reorder) ?? []) : [];\n\n        $data = $this->prepareStorage();","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/getgrav/grav/blob/6040efed04efa69b8209448ed81308e7c24147c2/system/src/Grav/Common/Flex/Types/Pages/PageObject.php#L206-L242","documentation":"Error \"Page /%s cannot be moved to non-existing path %s\" thrown in getgrav/grav.","triggerScenarios":"Thrown at system/src/Grav/Common/Flex/Types/Pages/PageObject.php:224 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"}