1 (edited by apmuthu 10/12/2015 09:44:12 am)

Topic: Uninstall user module error

If a user uploads a module into the modules folder, there will be no corresponding _init/config file in the modules/_cache folder. Installing the module goes without any issue (since it is already in place, but will benefit from such a check as well) but uninstalling it causes the error: "Cannot download repo index file.".

This is because the function uninstall() in includes/packages.inc attempts:

        $ctrl = get_control_file("$cachepath/_init/config");

without checking if the file exists!

Preceding it with the following and encompassing the next few statements within it should alleviate it:

if (file_exists("$cachepath/_init/config")) {
        $ctrl = get_control_file("$cachepath/_init/config");

        $targetdir = $path_to_root.'/'.$ctrl['InstallPath'];

        $dpackage = new package("$cachepath/_data", $targetdir);

        $flist = $dpackage->extract_files(true);

        $success &= copy_files($flist, "$cachepath/_back", $targetdir, true);
}

This will of course not purge the module from the modules folder ($ctrl['InstallPath'] is undefined) but will remove the module's entry from the installed_extensions.php files.


@joe: please verify and incorporate in the stable repo.

Post's attachments

user_module_uninstall_error.png 5.8 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

Re: Uninstall user module error

Okay, I will look into it.

Joe

3 (edited by apmuthu 10/12/2015 06:27:25 pm)

Re: Uninstall user module error

The Wiki has the variables inspected but may not be relevant here except as a means to investigate.