[Rt-devel] obscure stricture explosion
Nicholas Clark
nick at ccl4.org
Thu Jun 14 17:30:03 EDT 2007
On Thu, Jun 14, 2007 at 01:12:32PM -0400, Jesse Vincent wrote:
>
> On Jun 14, 2007, at 1:01 PM, Nicholas Clark wrote:
>
> >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);
> >
>
> Can I see the initialization of $t? In RT, you should ~always be
> handing a currentuser to ->new().
Code is at work, so I can't get to it from here, but (from memory) it was
$t = RT::Ticket->new($co_user);
# where $co_user was a user retrieved by name
$t->Create(...)
where a ticket is successfully created. (because it shows up)
I can give you the verbatim code by my tomorrow (by which time you'll be
asleep)
Nicholas Clark
More information about the Rt-devel
mailing list