Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin causes "Twig instantiated before Craft is fully initialized" warning #32

Open
FlorisDerks opened this issue Aug 3, 2022 · 0 comments · May be fixed by #33
Open

Plugin causes "Twig instantiated before Craft is fully initialized" warning #32

FlorisDerks opened this issue Aug 3, 2022 · 0 comments · May be fixed by #33

Comments

@FlorisDerks
Copy link

When I enable this plugin in Craft CMS v4.2.0.2 I get to see warnings telling me that Twig is instantiated too early (in the ./storage/logs/ directory or on the commandline when CRAFT_STREAM_LOG is active):

2022-08-03 11:32:08 [console.WARNING] [craft\web\View::createTwig] Twig instantiated before Craft is fully initialized. {"memory":22820336}

This seemed to be caused by the _addTwigExtensions() function that is called from the init-function in UserManual.php. This uses Craft::$app->view->twig->addExtension(new UserManualTwigExtension);, but according to https://craftcms.com/docs/4.x/extend/extending-twig.html#register-a-twig-extension should be Craft::$app->view->registerTwigExtension(new UserManualTwigExtension);

Would it be possible to fix this warning?

@braican braican linked a pull request Oct 7, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant