[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.

[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?


RELEVANT CODE from Attributes_Overlay (3.4.2)

sub _DoSearch {
     my $self = shift;

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.


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


=head2 Named STRING

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


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


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

492:    else {
493:    my ( $package, $filename, $line );
494:    ( $package, $filename, $line ) = caller;
496:    die "$AUTOLOAD Unimplemented in $package. ($filename line $line) 
497:    }
499:    }
stack:     /var/local/perl/lib/site_perl/5.8.3/DBIx/SearchBuilder/Record.pm:496

raw error

More information about the Rt-devel mailing list