summaryrefslogtreecommitdiff
path: root/rt
diff options
context:
space:
mode:
authorivan <ivan>2011-04-20 02:54:35 +0000
committerivan <ivan>2011-04-20 02:54:35 +0000
commita707e78a4083160c40f0a948a07be99d00263343 (patch)
tree0f9c2d29f39e1d7fafe18a14e9f99285f0e04418 /rt
parent2b1089b6ccdc34906b341a15e221caa027e1c9ce (diff)
fix missing _ImportOverlays in RT::Base, RT#12519
Diffstat (limited to 'rt')
-rw-r--r--rt/lib/RT/Base.pm22
1 files changed, 15 insertions, 7 deletions
diff --git a/rt/lib/RT/Base.pm b/rt/lib/RT/Base.pm
index f276aa24e..6c0a1739d 100644
--- a/rt/lib/RT/Base.pm
+++ b/rt/lib/RT/Base.pm
@@ -2,8 +2,8 @@
#
# COPYRIGHT:
#
-# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC
-# <jesse@bestpractical.com>
+# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+# <sales@bestpractical.com>
#
# (Except where explicitly superseded by other copyright notices)
#
@@ -51,6 +51,7 @@ use Carp ();
use Scalar::Util ();
use strict;
+use warnings;
use vars qw(@EXPORT);
@EXPORT=qw(loc CurrentUser);
@@ -87,7 +88,7 @@ sub CurrentUser {
$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 @@ sub loc_fuzzy {
}
}
-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;