{"record":{"id":"76e1c9b6794d12e2","repo":"getgrav/grav","slug":"not-implemented","errorCode":null,"errorMessage":"Not Implemented","messagePattern":"Not Implemented","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"system/src/Grav/Common/Assets/BlockAssets.php","lineNumber":64,"sourceCode":"                case 'links':\n                    static::registerLinks($assets, $groups);\n                    break;\n                case 'html':\n                    static::registerHtml($assets, $groups);\n                    break;\n            }\n        }\n    }\n\n    /**\n     * @param Assets $assets\n     * @param array $list\n     * @return void\n     */\n    protected static function registerFrameworks(Assets $assets, array $list): void\n    {\n        if ($list) {\n            throw new \\RuntimeException('Not Implemented');\n        }\n    }\n\n    /**\n     * @param Assets $assets\n     * @param array $groups\n     * @return void\n     */\n    protected static function registerStyles(Assets $assets, array $groups): void\n    {\n        $grav = Grav::instance();\n\n        /** @var Config $config */\n        $config = $grav['config'];\n\n        foreach ($groups as $group => $styles) {\n            foreach ($styles as $style) {\n                switch ($style[':type']) {","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/getgrav/grav/blob/6040efed04efa69b8209448ed81308e7c24147c2/system/src/Grav/Common/Assets/BlockAssets.php#L46-L82","documentation":"BlockAssets::registerFrameworks() is an explicit stub: any non-empty frameworks asset list immediately throws RuntimeException. When Grav renders an HtmlBlock outside a parent ContentBlock, TwigNodeRender compiles a call to BlockAssets::registerAssets(), which dispatches the frameworks category to this unimplemented method.","triggerScenarios":"Create an HtmlBlock, call $block->addFramework('jquery') or build it from serialized data containing a frameworks array, then render it through Grav's {% render %} node so registerAssets() runs. The non-empty list reaches BlockAssets.php:63-65 and throws 'Not Implemented'.","commonSituations":"A plugin or custom render implementation uses HtmlBlock::addFramework() expecting Grav to enqueue jQuery or another framework, or cached/serialized block data from older code contains frameworks entries and is rendered after an upgrade.","solutions":["Remove the addFramework() call and register the framework's CSS/JS explicitly through Grav's Assets API, for example $grav['assets']->addJs(...) and addCss(...).","Strip the frameworks entry from serialized HtmlBlock data before render.","If this is required functionality, implement registerFrameworks() in a fork or patch and upstream the change; the current shipped implementation intentionally rejects it.","Catch unsupported block shapes during development and fail with a clear plugin-level message instead of rendering them."],"exampleFix":"// before\n$block = HtmlBlock::create('widget');\n$block->addFramework('jquery');\n$html = $block->render(); // render path calls BlockAssets::registerAssets()\n\n// after\n$block = HtmlBlock::create('widget');\n$grav['assets']->addJs('plugin://my-plugin/assets/jquery.min.js');\n$html = $block->render();","handlingStrategy":"validation","validationCode":"$assets = $block->getAssets();\nif (!empty($assets['frameworks'])) {\n    throw new InvalidArgumentException('HtmlBlock frameworks are not supported by BlockAssets::registerAssets().');\n}\n$html = $block->render();","typeGuard":"function hasRenderableBlockAssets(HtmlBlock $block): bool\n{\n    $assets = $block->getAssets();\n    return empty($assets['frameworks']);\n}","tryCatchPattern":"try {\n    BlockAssets::registerAssets($block);\n} catch (RuntimeException $e) {\n    if ($e->getMessage() === 'Not Implemented') {\n        throw new LogicException('Register framework CSS/JS directly; frameworks are unsupported.', 0, $e);\n    }\n    throw $e;\n}","preventionTips":["Do not call HtmlBlock::addFramework() before Grav's render integration.","Register framework files with the Assets manager directly.","Reject serialized blocks containing frameworks until supported.","Add render tests for every custom HtmlBlock producer."],"tags":["grav","assets","htmlblock","not-implemented","render","twig"],"backgroundTag":"unsupported-asset-type","analyzedSha":"6040efed04efa69b8209448ed81308e7c24147c2","analyzedAt":"2026-08-17T05:07:31.593Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}