Strange problem - User object becomes string

Hello,

I’m trying to figure out a strange problem in one of our
customizations (RT 3.4.2, Apache 1.3.33, mod_perl 1.29. Perl 5.8.3, RHEL 3).

We inserted a callback into User/Prefs.html to provide a UI for
additional user preferences. Here’s what that looks like:

<& /Elements/Callback, user => $UserObj, results => @results, %ARGS &>

The problem is that sometimes (but not always) when we get into the
callback, the “user” argument is a string containing the current
user’s username, not a User object.

Here’s the relevant code in the callback:

<%ARGS>
$user => undef
@results => undef
</%ARGS>

Can anyone think why $user transforms from a User object into a
string? I’m wondering if there’s some kind of name collision between
the ‘user’ field entered on the login screen and my argument name.

Thanks,
Steve

Stephen Turner
Senior Programmer/Analyst - Client Support Services
MIT Information Services and Technology (IS&T)

Just in case anyone’s losing sleep over the problem below, we fixed
it… I’m fairly sure it was down to a
name collision between the ‘user’ arg that is supplied by the login
screen and the ‘user’ arg we pass to the mason component that
displays our additional preferences. We pass in an RT user object,
but the component gets a string with the username instead.

I don’t know why this would happen, but renaming the arg we pass to
the component to “User” seems to fix the problem.

Steve

At Thursday 9/28/2006 02:19 PM, Stephen Turner wrote: