Open bastrian opened 4 years ago
I know it's almost a year later, but this bug would be quite hard to patch evidently as the system would need to scan every version from every modpack for the mods that are left behind. It can be done, but the easiest thing to do is to just not remove versions from the mod library and to just remove the mod in the next version you release. I've talked with TheGameSpider on this one and it does seem like something that could be done, but likely is a large amount of work that can be a little resource-intense if used in hundreds of versions across multiple packs. Just wondering, why would you want to remove something from the mod library in the first place instead of just making a new version without it?
Maybe try something like:
$id = ;# mod ID that was removed
$modpacks = mysqli_get_array(mysqli_query($connect, "SELECT * FROM builds"));
foreach ($modpacks as $modpack) {
$modpackId=$modpack['id'];
$modpackMods = explode(',', $modpack['mods']) ;
if (in_array($id, $modpackMods) {
$indexOfId=array_search($id, $modpackMods);# this and below may not work.
unset($indexOfId, $modpackMods);
$modpackMods=array_values($modpackMods);
mysqli_query($connect, "UPDATE builds SET mods = ".$modpackMods." WHERE id = ".$modpackId)
}
}
Describe the bug When deleting a Mod from the Mod librarythe ID still stays in the modpack. It will show a blank entry in the Mod list of the Modpack
To Reproduce Steps to reproduce the behavior:
Expected behavior The Mod should be removed from the Modpack too. (Search all Modpacks, check for the ID and remove it)
Screenshots