[ic] AddAttr only UserTags sometimes work, sometimes fail

Chris Keane chris.keane at zzgi.com
Tue Apr 20 16:08:44 UTC 2010

Hi all,

IC 5.7.2, perl 5.10.0

I'm having a weird issue with some UserTags that have all attributes 
passed to them via AddAttr, for example:

UserTag demotag AddAttr
userTag demotag Routine <<EOR
     my ($opt) = @_;

The problem comes when accessing any of the members of the $opt hashref. 
For the sake of example, let's say that we have an argument to the 
UserTag called "thing", so the call would be
[demotag thing=thing_content]

Not all time, but SOMETIMES when I try to access some of the data, even 
very simply, for example

::logError("opt thing is ". $opt->{thing});

the tag fails and an error is written to the global error.log:
demo.html Died in server spawn: Can't use string ("thing_content") as a 
HASH ref while "strict refs" in use at (tag 'cgi') line 17.

This worked as expected in previous version of IC, and I suspect in 
later versions (for example, I haven't seen this problem come up on a 
5.7.4 server, not that it won't, just haven't seen it).

The weird part is that sometimes it works as I would expect. Then it 
will fail and consistently fail for some random period of time. Then it 
will work again.

I can work around the problem by providing an Order to the usertag:
UserTag demotag Order x
UserTag demotag AddAttr
userTag demotag Routine <<EOR
     my ($x,$opt) = @_;

Any thoughts or guidance?


More information about the interchange-users mailing list