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.