There isn't any way to define the maximum supported library version If you have a module that needs a specific older jQuery library version, because the newest version isn't tested or has some compatibility issues with other modules.
You can however define multiple supported version in your hook_libraries_info(). But it only checks if the library itself is equal or higher than the supported versions.
This doesn't allow the option for module maintainers to say through hook_requirements(): 'We support version 2.9 to 4.3, but not 4.4 or higher, because 4.4 or higher needs a rewrite of this module.'
Also the 'versions' array is unset, what could be very handy for your hook_requirements().
At the end this patch could help with downsizing the support questions in issue queues about library versions that doesn't work.
Comment | File | Size | Author |
---|---|---|---|
#4 | allow_to_define_the-2567525-4.patch | 5.08 KB | Tess Bakker |
Comments
Comment #2
Tess BakkerExample code to make version 3 or higher unsupported with the patch:
Comment #4
Tess BakkerNew patch, with tests for 'version too low' and 'version too high'.
In favor of succeeding the tests, I didn't remove the 'versions' element in the library array as seen in the first patch.
Comment #5
Tess BakkerComment #7
tstoecklerWow, I had always assumed specifying a max version was somehow possible, but you may be right, that we are missing this in the current implementation. Thanks for starting this!
Comment #8
Tess Bakker:) Let me know if I need to change something, couldn't found 'Failing Test' problem with the current patch.