Clarify Craft intialisation order for modules/plugins #9671
-
We are looking for clarifcation of the loading process used by Craft, specfically the order in which plugins, Twig extensions etc are intialised. This is in response to nystudio107/craft-seomatic#937 where Twig intialisation is called twice resulting in an internal server error. We believe the following is happening:
To remedy this we have wrapped the particular section of the module causing the exception in
If this is correct and expected then I assume this process (whatever this currently is) changed in Craft 3.7 as the above issue certainly didn't manifest until recently. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
If your module is listed in the Here’s the general order of request initialization:
Nothing changed about this in 3.7 that I can think of. It’s worked this way since 3.0. |
Beta Was this translation helpful? Give feedback.
If your module is listed in the
bootstrap
array inconfig/app.php
, thes you are correct, it will load before plugins.Here’s the general order of request initialization:
EVENT_INIT
eventNothing changed about this in 3.7 that I can think of. It’s worked this way since 3.0.