[ic] AddAttr only UserTags sometimes work, sometimes fail
David Christensen
david at endpoint.com
Tue Apr 20 17:07:53 UTC 2010
On Apr 20, 2010, at 11:08 AM, Chris Keane wrote:
>
> 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
> sub
> {
> 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
> sub
> {
> my ($x,$opt) = @_;
>
> Any thoughts or guidance?
>
> Chris.
Are these always called as [demotag thing=blah], or might they be getting called as positional params (i.e., [demotag blah])? I'm not sure offhand what the latter would produce. Also, is it an intermittent issue in the same (page, component, whatever)?
Regards,
David
--
David Christensen
End Point Corporation
david at endpoint.com
More information about the interchange-users
mailing list