Skip to content
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

[FR] - required plugins #11

Open
piotrpog opened this issue Jun 10, 2022 · 5 comments
Open

[FR] - required plugins #11

piotrpog opened this issue Jun 10, 2022 · 5 comments
Assignees

Comments

@piotrpog
Copy link

piotrpog commented Jun 10, 2022

Lets say that our theme requires some plugins to work correctly. For example, plugin that generates navigation.
Of course we can ser composer packages containing these plugins in required section of composer.json, but they still need to be enabled and installed.

So what i suggest is adding some logic to craft themes which would check if all "required" plugins for specific theme are installed and enabled. And if not, some warning would be displayed in control panel.

@ryssbowh
Copy link
Owner

Yes I have been thinking about this one too and I tried implementing it without success.
We can install those plugins in the beforeInstall method of a plugin main class and it does work. Until you deploy to a different environment and apply the config changes, then Craft will reinstall those plugins and modify the config, even if the config already has a mention of those plugins being installed.
Which can create problems when you're tracking code (with git for example) as it will create file changes.

I see you've added a discussion there, let's see what Craft says about that, as this can't be done at the moment.

@piotrpog
Copy link
Author

@ryssbowh
If we cannot have a reliable method of installing required plugins, why not have just a notification warning developer if required themes are not installed?

@ryssbowh
Copy link
Owner

You mean having a global warning in the CP telling you to install which and which plugin ?

@ryssbowh ryssbowh reopened this Jun 13, 2022
@piotrpog
Copy link
Author

piotrpog commented Jun 13, 2022

@ryssbowh
Yes, but not global in a way that Craft warns someone that his license file is missing. Maybe just display warning on theme plugin page?

@ryssbowh
Copy link
Owner

ryssbowh commented Jun 14, 2022

Honestly, as good as it would be to have this feature I think Craft would benefit from having it for all plugins, not only themes, and there are more problems that need solved :

  • Do we prevent users to disable a plugin that is listed as a dependency?
  • How do we get dependencies handles from a composer.json name. Probably best having handles listed on the plugin in a $dependencies attribute.
  • How do we handle circular dependencies (plugins that depends on each other)

For themes specifically, the handle mentionned in getExtends() will be automatically installed before installing a theme, and it does work, but it's not very clean and could benefit from some code change in Craft before we could apply this to a dependency system.

Let's wait and see if it's something Craft would potentially do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants