Bug 31684: Plugin versions starting with a "v" cause unnecessary warnings
authorKyle M Hall <kyle@bywatersolutions.com>
Wed, 17 Mar 2021 14:44:31 +0000 (10:44 -0400)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 21 Oct 2022 13:01:22 +0000 (10:01 -0300)
commitfd51a238c84b8e9ce5b0f276c4e35e287eb059da
tree4dccc8e2bca5355d0c13e90af488f8b67b951477
parenta26cc8a29bb86185a5131a21e4e25166c503323e
Bug 31684: Plugin versions starting with a "v" cause unnecessary warnings

Our code assumes that plugin version will be purely numeric ( e.g. 1.2.3 ) but many plugin authors ( including myself ) use the format "v1.2.3".
This causes warnings as we use a numeric comparison on the version numbers.
It could make sense to check for and strip any v's from the beginning of the version.

Test Plan:
1) Apply the first patch to set the test plugin's version to v1.01
2) prove t/db_dependent/Koha/Plugins/Plugins.t
3) Note the warnings and test failures
4) Apply this patch
5) prove t/db_dependent/Koha/Plugins/Plugins.t
6) All tests pass!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Koha/Plugins/Base.pm