[Rt-commit] r8204 - rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT
ruz at bestpractical.com
ruz at bestpractical.com
Wed Jul 18 07:13:27 EDT 2007
Author: ruz
Date: Wed Jul 18 07:13:24 2007
New Revision: 8204
Modified:
rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/ObjectCustomFields_Overlay.pm
Log:
* don't call the join method on the same aliases multiple times
Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/ObjectCustomFields_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/ObjectCustomFields_Overlay.pm (original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/ObjectCustomFields_Overlay.pm Wed Jul 18 07:13:24 2007
@@ -65,17 +65,19 @@
sub LimitToLookupType {
my $self = shift;
my $lookup = shift;
- unless ($self->{'_cfs_alias'}) {
- $self->{'_cfs_alias'} = $self->NewAlias('CustomFields');
- }
- $self->Join( ALIAS1 => 'main',
- FIELD1 => 'CustomField',
- ALIAS2 => $self->{'_cfs_alias'},
- FIELD2 => 'id' );
- $self->Limit( ALIAS => $self->{'_cfs_alias'},
- FIELD => 'LookupType',
- OPERATOR => '=',
- VALUE => $lookup );
+
+ $self->{'_cfs_alias'} ||= $self->Join(
+ ALIAS1 => 'main',
+ FIELD1 => 'CustomField',
+ TABLE2 => 'CustomFields',
+ FIELD2 => 'id',
+ );
+ $self->Limit(
+ ALIAS => $self->{'_cfs_alias'},
+ FIELD => 'LookupType',
+ OPERATOR => '=',
+ VALUE => $lookup,
+ );
}
sub HasEntryForCustomField {
More information about the Rt-commit
mailing list