wirecli / wire-cli

🌀 An extendable CLI tool for ProcessWire developers. Automate common tasks and manage your ProcessWire projects effortlessly.
MIT License
14 stars 0 forks source link

module:enable not working for copied-in or submodule add'ed modules. #13

Open netcarver opened 2 months ago

netcarver commented 2 months ago

@flydev-fr Hi Flydev - thank you for taking on this project.

The module:enable command fails to install modules that have been copied, or git submodule added, into the site/modules/ directory (rather than having been downloaded by wirecli) despite reporting success enabling the modules.

Once wirecli module:enable <module> is executed, and reporting success, then logging in to the PW admin interface and refreshing the modules list shows the modules as not being installed. If you install them in the PW admin interface, then wirecli is subsequently able to successfully uninstall (module:disable) and re-install (module:enable) the module as expected.

netcarver commented 2 months ago

Looking at the code - it just seems to call PW functions. Hmm, I wonder if there's a permissions issue or if there needs to be a PW module refresh for this to work.

netcarver commented 2 months ago

Must be something else. Will re-open if needed.

netcarver commented 2 months ago

Ok, so this issue persists, but only seems to happen if copied/added modules are wirecli module:enabled before the first login to the PW admin interface. Once I log in to the admin interface, I can then use wirecli to install the copied/added modules from the command line as expected.

To be clear, there are no issues with wirecli module:enable working for modules included with processwire when it was downloaded. These modules can be installed fine prior to the first admin login. Similarly, for modules that are downloaded by wirecli and then enabled. These work fine prior to first login. I'm having issues with the Pro modules I'm trying to copy over and then install in a bash script.

It's not permissions or the copied location - they all look good.

flydev-fr commented 2 months ago

Hi Steve, thanks for the detailed informations.

I think I have a Pro Modules at hand so I will test with it. It might be something related to the license flow, I have to read the core code to be sure. Will write here my results.

netcarver commented 2 months ago

Hi @flydev-fr , I don't think it's license flow as even non-pro modules I git submodule add to the project are impacted. I suspect it may be a matter of needing the enable command to do a modules refresh first - but that's an untested hypothesis at the moment.

flydev-fr commented 2 months ago

Oh ok I hadn't figured that out. I'd test with submodules so, possibly triggered a refresh yes.