Make sure required plugins are loaded in correct order #11676
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I noticed a bug when requiring a plugin.
If eg a plugin named
Acc
requires a plugin namedCli
, pluginAcc
will be not activated becauseAcc
will be always loaded beforeCli
. See the diff changes, so far we always sort custom plugins alphabetically. However, it should respect a required plugin and make sure to load a required plugin first. In this caseCli
beforeAcc
.While this PR should work, it is maybe a bit slow to load the
plugin.json
of each custom plugin each time for each request additionally (we load it again later in Metadata loader where it is cached). In tracker we would under circumstances not need to load it at all.@sgiehl @mattab maybe you guys have a better idea on how to fix it? AFAIK the DI container and environment is not set up at this time and caching this information is likely not really possible. Also we can often not write it directly into plugin.json as we may not have file permissions etc.