Currently there is mod validation functionality in js, which is kind of ignored and mods can get away not paying attention since except few warnings, nothing happens.
This is moving validation to c++, which marks mod as invalid and writes error code to be displayed.
Without this patch it is possible to break mod page by mod.js:
not defining json,
defining empty json,
not defining dependencies
Reasons why to not allow to enable not valid mods:
mod with invalid name cannot be compared as dependencies
mod with invalid version makes dependency comparisson impossible
mod with invalid dependency requirement cannot be checked [TODO: check this]
Merging functionality with compatible filter.
In case of invalid mod, showing error messaged instead of description.