Jump to content
matjazp

Delete module

Recommended Posts

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! 

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

@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...

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...