[Koha-bugs] [Bug 29008] Warning when checking Koha version in plugins
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Mon Apr 11 15:04:22 CEST 2022
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29008
--- Comment #11 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
(In reply to Martin Renvoize from comment #6)
> Comparing version numbers is fraught with peril :(..
>
> This error message has annoyed me too on a number of occasions.
>
> Do you realise we already have a '_version_compare' routine in
> Koha::Plugins::Base? Was it a deliberate choice not to use it?
The `_version_compare` sub is designed to validate plugin versions, so you can
detect a db change is required, there are examples in the wild [1].
Using it actually expects semver but deals with M.m as well.
I believe we should use something similar for checking Koha versions, as Frido
proposes. But I reckon it would probably be similar to what we do for plugin
versions.
[1]
https://gitlab.com/thekesolutions/plugins/koha-plugin-innreach/-/blob/master/Koha/Plugin/Com/Theke/INNReach.pm#L269-274
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list