Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter compatible modules by compatibility #2980

Merged
merged 2 commits into from Feb 2, 2020

Conversation

HebaruSan
Copy link
Member

Problem

When you check the mod list checkbox to install a mod, the latest version is chosen regardless of compatibility:

image

Cause

In #2963 we renamed Registry.Available to Registry.CompatibleModules and rewrote it to share a persistent data structure with Registry.IncompatibleModules that stores all the compatible AvailableModules in one list and the incompatible ones in another list. Then all we have to do is return one CkanModule per AvailableModule in a list.

Previously we returned the latest CkanModule regardless of its compatibility. This meant that when a GUIMod got constructed for a given row, its Mod property could be set to an incompatible CkanModule, and this is what is used for the default version to install.

Changes

Now we pass the version criteria to AvailableModule.Latest() when generating the list of CkanModules, so the list will contain actually compatible modules. This will allow GUIMod to select the correct Mod value.
(And pair is renamed to avail since these are AvailableModule objects rather than the KeyValuePairs that we would commonly see when working with a dictionary.)

image

Fixes #2979.

@HebaruSan HebaruSan added Bug Easy This is easy to fix Core (ckan.dll) Issues affecting the core part of CKAN Pull request Registry Issues affecting the registry labels Jan 31, 2020
@HebaruSan HebaruSan removed the request for review from DasSkelett February 2, 2020 03:33
@politas politas merged commit bae5065 into KSP-CKAN:master Feb 2, 2020
@HebaruSan HebaruSan deleted the fix/latest-compat branch February 2, 2020 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Core (ckan.dll) Issues affecting the core part of CKAN Easy This is easy to fix Pull request Registry Issues affecting the registry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Latest Release pulls in incompatible versions of mods
2 participants