You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updating from 3.0.3.1 to 3.0.5, Craft is unable to run database migrations due to the following exception:
LogicException
Unable to register extension "namespace\module\twigextensions\SomeTwigExtension" as extensions have already been initialized.
The exception is only thrown if there are pending database migrations. If the calls to Craft::$app->getView()->registerTwigExtension() are removed from the modules, the migrations/update completes successfully. After updating, the calls to registerTwigExtension() can be added back in without the exception being thrown on subsequent requests.
Steps to reproduce
Add a custom Twig extension to a module's constructor or init() method using Craft::$app->getView()->registerTwigExtension()
Make sure there are pending database migrations
Visit /admin to run the migrations
Confirm that a LogicException is thrown
Additional info
Craft version: 3.0.5
PHP version:
Database driver & version:
Plugins & versions:
The text was updated successfully, but these errors were encountered:
Description
Possibly related to #2831:
Updating from 3.0.3.1 to 3.0.5, Craft is unable to run database migrations due to the following exception:
The exception is only thrown if there are pending database migrations. If the calls to
Craft::$app->getView()->registerTwigExtension()
are removed from the modules, the migrations/update completes successfully. After updating, the calls toregisterTwigExtension()
can be added back in without the exception being thrown on subsequent requests.Steps to reproduce
init()
method usingCraft::$app->getView()->registerTwigExtension()
LogicException
is thrownAdditional info
The text was updated successfully, but these errors were encountered: