diff --git a/Koha/Template/Plugin/Koha.pm b/Koha/Template/Plugin/Koha.pm index e32a9e7905..944be615c4 100644 --- a/Koha/Template/Plugin/Koha.pm +++ b/Koha/Template/Plugin/Koha.pm @@ -24,6 +24,7 @@ use base qw( Template::Plugin ); use C4::Context; use Koha::Token; use Koha; +use Koha::Status; use Koha::Cache::Memory::Lite; use Koha::ContentSecurityPolicy; @@ -131,16 +132,7 @@ Missing POD for Version. =cut sub Version { - my $version_string = Koha::version(); - my ( $major, $minor, $maintenance, $development ) = split( '\.', $version_string ); - - return { - major => $major, - minor => $minor, - release => $major . "." . $minor, - maintenance => $major . "." . $minor . "." . $maintenance, - development => ( $development ne '000' ) ? $development : undef, - }; + return Koha::Status->new()->version(); } =head3 GenerateCSRF diff --git a/t/Koha_Template_Plugin_Koha.t b/t/Koha_Template_Plugin_Koha.t index 99baa31ab5..c16bbd4e8c 100755 --- a/t/Koha_Template_Plugin_Koha.t +++ b/t/Koha_Template_Plugin_Koha.t @@ -63,7 +63,8 @@ subtest "Koha::Template::Plugin::Koha::Version tests" => sub { minor => $minor, release => $major . "." . $minor, maintenance => $major . "." . $minor . "." . $maintenance, - development => $development + development => $development, + version => $version, }, "Correct development version" ); @@ -82,7 +83,8 @@ subtest "Koha::Template::Plugin::Koha::Version tests" => sub { minor => $minor, release => $major . "." . $minor, maintenance => $major . "." . $minor . "." . $maintenance, - development => undef + development => undef, + version => $version, }, "Correct maintenance version" );