[Rt-devel] obscure stricture explosion

Nicholas Clark nick at ccl4.org
Thu Jun 14 13:01:02 EDT 2007

If I'm getting this error message:

Can't locate object method "EmailAddress" via package "No object mapping for field" (perhaps you forgot to load "No object mapping for field"?) at lib/RT/Ticket_Overlay.pm line 1351.

where the offending lines in 3.6.3's RT/Ticket_Overlay.pm are:

    if ( $self->CurrentUser->PrincipalId == ($args{'PrincipalId'} || 0)
       or    lc( $self->CurrentUser->UserObj->EmailAddress )
          eq lc( RT::User::CanonicalizeEmailAddress(undef, $args{'Email'}) || '' ) )

and my calling code is

$t->AddWatcher(Type => 'Cc', PrincipalId => $g->Id);

where $g->Id is 55, and $t is a valid RT::Ticket object

then, where do I start looking to work out what my bug is?

My script (it's trying to be a regression test) started with:


And I'd not set CurrentUser. Is that my problem?

Nicholas Clark

More information about the Rt-devel mailing list