[Rt-devel] spurious error being presented to users

Olly Stephens Olly.Stephens at arm.com
Wed Jan 14 09:00:27 EST 2009


Olly Stephens wrote:
>
> On our production system, we are occasionally getting the following
> error presented to users on the web page:
>
> Can't use string ("RT::User") as a HASH ref while "strict refs" in use
> at /opt/perl/lib/site_perl/5.8.8/DBIx/SearchBuilder/Record.pm line
389.


OK, I've tracked down one place where it's occurring and it's mea culpa.

In my custom override for RT::User::CanonicalizeEmailAddress I was
assuming that I was being called as an object method but in fact it's as
a class method.  So $_[0] is the string 'RT::User' rather than a valid
object.  I was using it to call other RT::User methods that expect a
valid object and this error was occurring when they were trying to test
fields.

I discovered this because the error occurred in a different place in my
development world and included a stack trace.  So I'm not 100% convinced
it's the same instance but the only way to see is to push a fix out to
production and see if it stops the error from occurring.

Olly



More information about the Rt-devel mailing list