[Rt-devel] RT::Attribute::Name Unimplemented in RT::Attributes error

Stephen Turner sturner at MIT.EDU
Mon Dec 19 11:40:16 EST 2005


At Monday 12/19/2005 10:25 AM, Stephen Turner wrote:
>At Friday 12/2/2005 06:17 PM, Jesse Vincent wrote:
>>DBIx::SearchBuilder is currently winging its way to a CPAN mirror near
>>you.  This version should fix the "Attribute::Name is undefined" error
>>folks have been seeing.
>>
>>Jesse
>
>Jesse,

[This seems more of a dev issue so I've moved it to the devel list]

As I mentioned earlier, the upgrade to SB 1.36 didn't solve this, in fact 
I've been seeing it more frequently since the upgrade. I've done some more 
investigation and I seem to have hit upon something that gets rid of the 
error, although I've no idea why it works.

I was thinking the problem must lie in Attributes_Overlay.pm - this is the 
only module in lib/RT that builds a cache from its objects after doing a 
search and this part of the code is what triggers the error.

On a (misguided) hunch, I decided to rename the cache from $self->{'attr'} 
to $self->{'attrx'} and lo and behold the error stopped happening. I 
changed it back and the error started again.

I've no idea why this might stop the error, except to speculate that 
$self->{'attr'} is used somewhere else in the collection class and the use 
of it in _BuildAccessTable is causing a name collision?

Steve

RELEVANT CODE from Attributes_Overlay (3.4.2)

sub _DoSearch {
     my $self = shift;
     $self->SUPER::_DoSearch();
     $self->_BuildAccessTable();
}


sub _BuildAccessTable {
     my $self = shift;
     delete $self->{'attr'};
     while (my $attr = $self->Next) {
         push @{$self->{'attr'}->{$attr->Name}}, $attr;
     }
}


sub _AttrHash {
     my $self = shift;
     $self->_DoSearch if ($self->{'must_redo_search'});
     unless ($self->{'attr'}) {
         $self->{'attr'}->{'__none'} = RT::Attribute->new($self->CurrentUser);
     }
     return ($self->{'attr'});
}

=head2 Names

Returns a list of the Names of all attributes for this object.

=cut

sub Names {
     my $self = shift;
     my @keys =  keys %{$self->_AttrHash};
     return(@keys);


}

=head2 Named STRING

Returns an array of all the RT::Attribute objects with the name STRING

=cut

sub Named {
     my $self = shift;
     my $name = shift;
     my @attributes;
     if ($self->_AttrHash) {
         @attributes = @{($self->_AttrHash->{$name}||[])};
     }
     return (@attributes);
}



ERROR MESSAGE:

RT::Attribute::Name Unimplemented in RT::Attributes. 
(/var/rt3/lib/RT/Attributes_Overlay.pm line 79)

context:
...
492:    else {
493:    my ( $package, $filename, $line );
494:    ( $package, $filename, $line ) = caller;
495:
496:    die "$AUTOLOAD Unimplemented in $package. ($filename line $line) 
\n";
497:    }
498:
499:    }
500:
...
code 
stack:     /var/local/perl/lib/site_perl/5.8.3/DBIx/SearchBuilder/Record.pm:496
/var/rt3/lib/RT/Attributes_Overlay.pm:79
/var/rt3/lib/RT/Attributes_Overlay.pm:71
/var/rt3/lib/RT/Attributes_Overlay.pm:86
/var/rt3/lib/RT/Attributes_Overlay.pm:117
/var/rt3/share/html/Search/Elements/SelectSearchesForObjects:58
/var/rt3/share/html/Search/Elements/EditSearches:75
/var/rt3/share/html/Search/Build.html:79
/var/rt3/share/html/autohandler:215

raw error



More information about the Rt-devel mailing list