[freeside-commits] freeside/rt/lib/RT Base.pm,1.1.1.9,1.1.1.9.4.1
Ivan,,,
ivan at wavetail.420.am
Tue Apr 19 19:54:37 PDT 2011
Update of /home/cvs/cvsroot/freeside/rt/lib/RT
In directory wavetail.420.am:/tmp/cvs-serv16630
Modified Files:
Tag: FREESIDE_2_1_BRANCH
Base.pm
Log Message:
fix missing _ImportOverlays in RT::Base, RT#12519
Index: Base.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/rt/lib/RT/Base.pm,v
retrieving revision 1.1.1.9
retrieving revision 1.1.1.9.4.1
diff -u -w -d -r1.1.1.9 -r1.1.1.9.4.1
--- Base.pm 31 Dec 2009 13:10:05 -0000 1.1.1.9
+++ Base.pm 20 Apr 2011 02:54:35 -0000 1.1.1.9.4.1
@@ -2,8 +2,8 @@
#
# COPYRIGHT:
#
-# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC
-# <jesse at bestpractical.com>
+# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+# <sales at bestpractical.com>
#
# (Except where explicitly superseded by other copyright notices)
#
@@ -51,6 +51,7 @@
use Scalar::Util ();
use strict;
+use warnings;
use vars qw(@EXPORT);
@EXPORT=qw(loc CurrentUser);
@@ -87,7 +88,7 @@
$self->{'original_user'} = $self->{'user'};
my $current_user = $_[0];
if ( ref $current_user eq 'RT::User' ) {
- $self->{'user'} = new RT::CurrentUser;
+ $self->{'user'} = RT::CurrentUser->new;
$self->{'user'}->Load( $current_user->id );
} else {
$self->{'user'} = $current_user;
@@ -163,10 +164,17 @@
}
}
-eval "require RT::Base_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Base_Vendor.pm});
-eval "require RT::Base_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Base_Local.pm});
+sub _ImportOverlays {
+ my $class = shift;
+ my ($package,undef,undef) = caller();
+ $package =~ s|::|/|g;
+ for (qw(Overlay Vendor Local)) {
+ my $filename = $package."_".$_.".pm";
+ eval { require $filename };
+ die $@ if ($@ && $@ !~ qr{^Can't locate $filename});
+ }
+}
+__PACKAGE__->_ImportOverlays();
1;
More information about the freeside-commits
mailing list