Commit 1d241ebe authored by Thomas Sibley's avatar Thomas Sibley
Browse files

Always declare base class before use-ing other RT:: classes

This will help avoid weird, hard to track down load ordering bugs in the
future.
parent e0a20849
......@@ -65,10 +65,10 @@ my $ACL = RT::ACL->new($CurrentUser);
package RT::ACL;
use RT::ACE;
use base 'RT::SearchBuilder';
use RT::ACE;
sub Table { 'ACL'}
use strict;
......
......@@ -62,8 +62,6 @@ package RT::Action::NotifyGroupAsComment;
use strict;
use warnings;
use RT::Action::NotifyGroup;
use base qw(RT::Action::NotifyGroup);
sub SetReturnAddress {
......
......@@ -71,11 +71,10 @@ package RT::Attachments;
use strict;
use warnings;
use base 'RT::SearchBuilder';
use RT::Attachment;
use base 'RT::SearchBuilder';
sub Table { 'Attachments'}
......
......@@ -68,11 +68,10 @@ package RT::Attributes;
use strict;
use warnings;
use base 'RT::SearchBuilder';
use RT::Attribute;
use base 'RT::SearchBuilder';
sub Table { 'Attributes'}
......
......@@ -69,11 +69,10 @@ package RT::CachedGroupMembers;
use strict;
use warnings;
use base 'RT::SearchBuilder';
use RT::CachedGroupMember;
use base 'RT::SearchBuilder';
sub Table { 'CachedGroupMembers'}
# {{{ LimitToUsers
......
......@@ -88,14 +88,13 @@ passed to Load method.
package RT::CurrentUser;
use RT::I18N;
use strict;
use warnings;
use base qw/RT::User/;
use RT::I18N;
#The basic idea here is that $self->CurrentUser is always supposed
# to be a CurrentUser object. but that's hard to do when we're trying to load
# the CurrentUser object
......
......@@ -54,8 +54,8 @@ package RT::CustomFieldValue;
no warnings qw/redefine/;
use RT::CustomField;
use base 'RT::Record';
use RT::CustomField;
sub Table {'CustomFieldValues'}
......
......@@ -51,12 +51,10 @@ package RT::CustomFieldValues;
use strict;
use warnings;
use base 'RT::SearchBuilder';
use RT::CustomFieldValue;
use base 'RT::SearchBuilder';
sub Table { 'CustomFieldValues'}
sub _Init {
......
......@@ -68,12 +68,12 @@ package RT::CustomFields;
use strict;
use warnings;
use base 'RT::SearchBuilder';
use DBIx::SearchBuilder::Unique;
use RT::CustomField;
use base 'RT::SearchBuilder';
sub Table { 'CustomFields'}
sub _Init {
......
......@@ -67,13 +67,13 @@
package RT::Dashboard;
use RT::SavedSearch;
use strict;
use warnings;
use base qw/RT::SharedSetting/;
use RT::SavedSearch;
use RT::System;
RT::System::AddRights(
SubscribeDashboard => 'Subscribe to dashboards', #loc_pair
......
......@@ -67,12 +67,12 @@
package RT::Dashboards;
use RT::Dashboard;
use strict;
use warnings;
use base 'RT::SharedSettings';
use RT::Dashboard;
sub RecordClass {
return 'RT::Dashboard';
}
......
......@@ -69,10 +69,10 @@ package RT::GroupMembers;
use strict;
use warnings;
use RT::GroupMember;
use base 'RT::SearchBuilder';
use RT::GroupMember;
sub Table { 'GroupMembers'}
......
......@@ -74,14 +74,11 @@ package RT::Groups;
use strict;
use warnings;
use RT::Group;
use base 'RT::SearchBuilder';
sub Table { 'Groups'}
use RT::Group;
use RT::Users;
# XXX: below some code is marked as subject to generalize in Groups, Users classes.
......
......@@ -70,11 +70,10 @@ package RT::Links;
use strict;
use warnings;
use base 'RT::SearchBuilder';
use RT::Link;
use base 'RT::SearchBuilder';
sub Table { 'Links'}
......
......@@ -50,6 +50,7 @@ package RT::ObjectCustomFieldValue;
use strict;
use warnings;
use base 'RT::Record';
use RT::Interface::Web;
use Regexp::Common qw(RE_net_IPv4);
......@@ -60,10 +61,7 @@ require Net::CIDR;
# Allow the empty IPv6 address
$IPv6_re = qr/(?:$IPv6_re|::)/;
use RT::CustomField;
use base 'RT::Record';
sub Table {'ObjectCustomFieldValues'}
......
......@@ -51,11 +51,10 @@ package RT::ObjectCustomFieldValues;
use strict;
use warnings;
use base 'RT::SearchBuilder';
use RT::ObjectCustomFieldValue;
use base 'RT::SearchBuilder';
sub Table { 'ObjectCustomFieldValues'}
sub _Init {
......
......@@ -63,12 +63,10 @@ use strict;
use warnings;
no warnings 'redefine';
use RT::Record;
use RT::Topic;
use base qw( RT::Record );
use RT::Topic;
sub _Init {
my $self = shift;
......
......@@ -70,10 +70,10 @@ use strict;
use warnings;
use RT::Principal;
use base 'RT::SearchBuilder';
use RT::Principal;
sub Table { 'Principals'}
sub _Init {
......
......@@ -69,11 +69,10 @@ package RT::Queues;
use strict;
use warnings;
use base 'RT::SearchBuilder';
use RT::Queue;
use base 'RT::SearchBuilder';
sub Table { 'Queues'}
# {{{ sub _Init
......
......@@ -67,12 +67,12 @@
package RT::SavedSearches;
use RT::SavedSearch;
use strict;
use warnings;
use base 'RT::SharedSettings';
use RT::SavedSearch;
sub RecordClass {
return 'RT::SavedSearch';
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment