RobErskine / Craft-User-Manual

📚 Help Section Plugin for Craft CMS.
MIT License
85 stars 17 forks source link

Update to use `registerTwigExtension` #33

Closed braican closed 1 month ago

braican commented 1 year ago

This PR moves to the registerTwigExtension method to register the Twig extension, as documented in the 4.x docs: https://craftcms.com/docs/4.x/extend/extending-twig.html#register-a-twig-extension. This fixes the Twig instantiated before Craft is fully initialized. warning that the plugin is throwing on each request in Craft 4 installations.

Fixes https://github.com/RobErskine/Craft-User-Manual/issues/32.

How to test

RobErskine commented 1 year ago

Thanks @braican! Will try to take a look over the next few days to get this merged in.

arnedem commented 1 year ago

@RobErskine Any progress on this? This change also fixes an issue when applying existing project config settings on a fresh install: can't apply existing project config: Unable to register extension "roberskine\usermanual\twigextensions\UserManualTwigExtension" as it is already registered.

mike-moreau commented 6 months ago

@RobErskine would be nice to see this merged in

RobErskine commented 1 month ago

This has been included in 5.0.2: https://github.com/RobErskine/Craft-User-Manual/releases/tag/5.0.2