Bug 23230: Make _version_compare OO context aware
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 1 Jul 2019 14:42:51 +0000 (11:42 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 3 Jul 2019 13:08:09 +0000 (14:08 +0100)
commit90acef7a9b860e70631ff243c21b435a7d081a16
treea11ea0f648360a37e027be424171a50d690794cf
parent2ff5f9fb633e6f3786b093d2a2f202a66db7b3d0
Bug 23230: Make _version_compare OO context aware

On using _version_compare in plugins development, it would be nice if it
was able to be called as an object method. This way we don't need to
fully qualify it like this:

    Koha::Plugins::Base::_version_compare

and we can do

    $self->_version_compare

instead.

This patch implements this behavior change. It is backwards compatible
so plugins using the 'old way' don't break.

To test:
- Apply the unit tests patch
- Run:
  $ kshell
 k$ prove t/db_dependent/Plugins.t
=> FAIL: Tests fail
- Apply this patch
- Run:
 k$ prove t/db_dependent/Plugins.t
=> SUCCESS: Tests pass!
- Sign off :-D

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Koha/Plugins/Base.pm