{"record":{"id":"691497254973907f","repo":"getgrav/grav","slug":"page-not-available-for-self-reference-s","errorCode":null,"errorMessage":"Page not available for self@ reference: %s","messagePattern":"Page not available for self@ reference: (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"system/src/Grav/Common/Utils.php","lineNumber":1712,"sourceCode":"     *\n     * @param string $path\n     * @param FlexObjectInterface|PageInterface|null $object\n     * @return string\n     * @throws RuntimeException\n     */\n    public static function getPathFromToken($path, $object = null)\n    {\n        $matches = static::resolveTokenPath($path);\n        if (null === $matches) {\n            return $path;\n        }\n\n        $grav = Grav::instance();\n\n        switch ($matches[0]) {\n            case 'self':\n                if (!$object instanceof MediaInterface) {\n                    throw new RuntimeException(sprintf('Page not available for self@ reference: %s', $path));\n                }\n\n                if ($matches[2] === '') {\n                    if ($object->exists()) {\n                        $route = '/' . $matches[1];\n\n                        if ($object instanceof PageInterface) {\n                            return trim($object->relativePagePath() . $route, '/');\n                        }\n\n                        $folder = $object->getMediaFolder();\n                        if ($folder) {\n                            return trim($folder . $route, '/');\n                        }\n                    } else {\n                        return '';\n                    }\n                }","sourceCodeStart":1694,"sourceCodeEnd":1730,"githubUrl":"https://github.com/getgrav/grav/blob/6040efed04efa69b8209448ed81308e7c24147c2/system/src/Grav/Common/Utils.php#L1694-L1730","documentation":"Error \"Page not available for self@ reference: %s\" thrown in getgrav/grav.","triggerScenarios":"Thrown at system/src/Grav/Common/Utils.php:1712 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"}