-
Notifications
You must be signed in to change notification settings - Fork 630
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 loading order is not deterministic #10441
Labels
Comments
This was referenced Jan 29, 2022
Fixed for the next release! Now we wait for someone to release “AAA SEO”… |
Yeah, I know, I know re: "AAA SEO" but at least it'll be the same on every install. I'm with @AugustMiller that plugins should be agnostic about loading order, but this will make it easier to debug when something goes wrong. Thx @brandonkelly ! |
3.7.31 is out now with that change. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently
services/Plugins
loads plugins with this query:ref: https://github.com/craftcms/cms/blob/develop/src/services/Plugins.php#L198
Unfortunately, this means that plugin loading order is not deterministic; it depends on in what order plugins are installed. This makes it difficult to track down issues such at this one in SEOmatic, because plugins will load in a different order on Site A than Site B:
nystudio107/craft-seomatic#654 (comment)
...where the issue only happens if SEOmatic is installed before Craft Commerce is installed. So obviously an issue on my end that will be fixed, but I think it would make diagnosing issues such as this easier if plugins were always loaded in a deterministic order, just like MacOS kernel extensions and other such things are.
So I propose changing the query to:
...so that plugins will always be loaded in a deterministic order, alphabetically by their plugin handle.
While it may seem like it's a breaking change in terms of affecting the loading order of plugins, you're actually making that same breaking change yourself every time you install or uninstall a plugin.
Deterministic loading order across sites is always better than random on a per-site basis, based on a hidden variable (install order)
Related: #3028
The text was updated successfully, but these errors were encountered: