[Rt-commit] rt branch, 4.2/plugin-distribution-name, created. rt-4.2.6-179-gc95c659

Alex Vandiver alexmv at bestpractical.com
Wed Mar 4 16:47:09 EST 2015


The branch, 4.2/plugin-distribution-name has been created
        at  c95c65979fc16503e73ad4d55fb9933cafa1e836 (commit)

- Log -----------------------------------------------------------------
commit c95c65979fc16503e73ad4d55fb9933cafa1e836
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Tue Sep 9 15:48:32 2014 -0400

    Allow the distribution name (not the package) for plugins
    
    Despite the documentation, it is a not uncommon error that users provide
    the distribution name instead of the package name.  Since this is a
    recoverable error, detect and deal with this error.

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index d43614d..327c8a1 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -121,6 +121,9 @@ to the enabled C<@Plugins> list:
     Plugin( "RT::Extension::SLA" );
     Plugin( "RT::Authen::ExternalAuth" );
 
+RT will also accept the distribution name (i.e. C<RT-Extension-SLA>)
+instead of the package name (C<RT::Extension::SLA>).
+
 =cut
 
 Set(@Plugins, ());
diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
index 4329fdb..6586a2d 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -1088,6 +1088,7 @@ sub _LoadConfig {
         };
         local *Plugin = sub {
             my (@new_plugins) = @_;
+            @new_plugins = map {s/-/::/g if not /:/; $_} @new_plugins;
             my ( $pack, $file, $line ) = caller;
             return $self->SetFromConfig(
                 Option     => \@RT::Plugins,

-----------------------------------------------------------------------


More information about the rt-commit mailing list