[rt-devel] Trying to expand WebRT

Jaime Kikpole jkikpole at cairodurham.org
Sun Dec 15 01:56:37 EST 2002

	I'm trying to write additional web fronts to RT.  I picked up a
book on Mason and read as much as I could in the last day or so.  So I
tried to test my new knowledge (I tried to write a simple script) and hit
a problem.  I'm hoping that someone here can show me what I'm

Code in /path/to/rt/local/WebRT/html/NoAuth/test7.html:

<& /Elements/Header &>
Ticket: <% $ticket->Id %>
Owner: <% $ticket->OwnerObj->RealName %>
%#Subject: <% $ticket->Subject %>
%#Status: <% $ticket->Status %>
$id => undef
#my $user = new RT::CurrentUser('guest');
my $ticket = new RT::Ticket('guest');

	This more or less works.  The Header file is included just to show
me who is "logged in" on the page.  Then I uncomment the line that
displays the subject.  (i.e. "%#Subject: <% $ticket->Subject %>" has the
leading "%#" removed)  This causes the following error message:

Mason error
error in file:   /usr/local/rt-2-0-6/lib/RT/Ticket.pm
                 line 2836: Can't locate object method "UserObj" via package "guest"

context:         ...
                 2832: sub CurrentUserHasRight {
                 2833: my $self = shift;
                 2834: my $right = shift;
                 2836: return ($self->HasRight( Principal=> $self->CurrentUser->UserObj(),
                 2837: Right => "$right"));
                 2839: }
component stack: /NoAuth/test7.html [local]
                 /autohandler [standard]
code stack:      /usr/local/rt-2-0-6/lib/RT/Ticket.pm:2786

	I'm kind of new to OOP, so I'm probably missing something obvious.
Can anyone explain what I did wrong?

							Thanks in advance,

Network Administrator
Cairo-Durham Central School District

More information about the Rt-devel mailing list