[Rt-commit] rt branch, 4.4/handle-alphabet-in-plugin-version, created. rt-4.4.2-239-g81332f6dd
? sunnavy
sunnavy at bestpractical.com
Mon May 21 14:02:49 EDT 2018
The branch, 4.4/handle-alphabet-in-plugin-version has been created
at 81332f6dd5b4eec9d011fcc03a0fbfed9022f0a0 (commit)
- Log -----------------------------------------------------------------
commit 81332f6dd5b4eec9d011fcc03a0fbfed9022f0a0
Author: sunnavy <sunnavy at bestpractical.com>
Date: Tue May 22 01:37:59 2018 +0800
Handle alphabetic words in RT::Plugin::Version
Perl's VERSION method doesn't support alphabetic words like "0.3beta",
and it dies with message:
Invalid version format (non-numeric data)
Thus, to support versions like "0.3beta" for RT plugins and render them
correctly on system configuration page, we can't use the VERSION method,
instead, we can use plugins' $VERSION variables directly.
diff --git a/lib/RT/Plugin.pm b/lib/RT/Plugin.pm
index d73029fdf..ef3ee9572 100644
--- a/lib/RT/Plugin.pm
+++ b/lib/RT/Plugin.pm
@@ -92,7 +92,8 @@ Returns the extension version.
sub Version {
my $self = shift;
- return $self->Name->VERSION;
+ no strict 'refs';
+ return ${$self->Name . '::VERSION'};
}
=head2 Path
-----------------------------------------------------------------------
More information about the rt-commit
mailing list