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

Add 'lost' command #268

Open
ghost opened this issue Mar 13, 2023 · 3 comments
Open

Add 'lost' command #268

ghost opened this issue Mar 13, 2023 · 3 comments

Comments

@ghost
Copy link

ghost commented Mar 13, 2023

I used to use this for my D7 sites, and I think it'd be a good addition to Bee: https://gist.github.com/kalabro/3187485

It "lists projects which are not installed or disabled. It can be useful to detect waste modules which [were] downloaded once and then forgotten."

@ghost ghost added the type: enhancement label Mar 13, 2023
@ghost
Copy link
Author

ghost commented Mar 13, 2023

Here's where I tried (but failed) to get this added to Drush: backdrop-contrib/backdrop-drush-extension#73

Here's a Gist I made specifically for Backdrop: https://gist.github.com/BWPanda/c82f09d8490b5a04a8b5468e001df642

And here's my PR for Drush (an updated version of my Gist): https://github.com/backdrop-contrib/backdrop-drush-extension/pull/152/files

I think the latter should be used for Bee (but I haven't looked through the code to see if it's still working/relevent).

@yorkshire-pudding
Copy link
Collaborator

A thought I had about this: what about multisites? How would the command work to ensure that a module in the shared modules folder is not in use by any of the sites?
I like the idea, but I can't see in the PR or gists how this is catered for.
In my mind, it has to:

  • go through all sites in a single pass:
    • add all the modules it finds in the shared folder to an array and start a count of which sites have that module enabled
    • for each site where it finds a disabled module it captures the status (disabled/not installed)
    • flags up the modules with an enabled count of 0
  • for each site, look in the site specific modules folder
    • handle these in the usual way, but will need to be presented per site

Or should it just be run separately and the site admin has to manually compare the lists for each site? If so, then the use case for #185 gets even stronger.

@ghost
Copy link
Author

ghost commented Mar 24, 2023

Hmm, good point. It's been a long time since I've looked at this, so I can't recall if I considered multisites back then...

But thinking about it now I'd be tempted to just list any 'lost' modules in the shared directory separately (or with an asterisk) and note that they may be in-use by other sites. Then leave it up to the admin to decide how to deal with them.

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

No branches or pull requests

1 participant