matjazp Posted January 25, 2020 Posted January 25, 2020 I have this folder structure in my modules folder: C:/inetpub/wwwroot/site/modules/Aa |-Aa.module |-folder B- |-folder C That is, in folder Aa there is folder B and inside is folder C. When I delete this module via modules I get an error that module Aa can't be deleted. File Aa.module is deleted, folder C is deleted, but folder B is not deleted and because of that folder A is not empty and also not deleted. The odd thing is that when I do wireRmdir("C:/inetpub/wwwroot/site/modules/A", true); in my template file, the folder is deleted as expected. Anyone willing to try? I found out that commenting the do loop in ProcessModule.module, around line 2126 makes it work!
dragan Posted January 25, 2020 Posted January 25, 2020 I would take a look how other module developers handled this. A good example is Tracy Debugger (or probably any other module that has lots of files/sub-directories), e.g. if($this->wire('input')->post->uninstallModule) { $dependents = $this->wire('modules')->getRequiresForUninstall($class); and then the relevant code in wire/code/Modules.php getRequiresForUninstall + public function ___delete($class)
matjazp Posted January 25, 2020 Author Posted January 25, 2020 @dragan maybe I wasn't clear: I'm not developing a module and I'm not trying to delete a module from any other module or template or any other script. I just want to delete the module(s) using PW admin interface. It's actually public function ___delete($class) that fails...
matjazp Posted January 25, 2020 Author Posted January 25, 2020 Found what was going on and created the issue https://github.com/processwire/processwire-issues/issues/1076 I would still be happy if someone else coud test it...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now