[ic] if explicit problem with data tag

Peter Ajamian pajamian at pajamian.dhs.org
Sat Nov 21 23:16:30 UTC 2009


On 22/11/09 08:36, Rick Bragg wrote:
> Hi,
> 
> The following works perfect:
> 
> [if type=explicit compare="$Tag->scratch({ name => test_[data session arg], })"]

I can't see how that would work, perl arguments must be quoted, for example:

[if type=explicit compare="$Tag->scratch({ name => 'test_[data session
arg]' })"]

but it would be better to do any of the following (in increasing order
of bad to best):
[if type=explicit compare="$Tag->scratch('test_[data session arg]')"]
[if type=explicit compare="$Scratch->{"test_$Session->{arg}"}"]
[if type=scratch term="test_[data session arg]"]

> However, the next case produces an Internal Server Error with nothing in
> the logs:
> 
> [if type=explicit compare="$Tag->data({ table => groups, column => description,  key => [data session arg], })"]

Again, problem with quoting args in perl, but you also have the problem
that the groups table may not be open at the time this code is run.  You
need to ensure it is by opening the table above the [if] tag:
[perl groups][/perl]
[if type=explicit compare="$Tag->data('groups', 'description',
$Session->{arg})"]

...but far better is to simply do this (no need to open the table this way):
[if type=data term="groups::description::[data session arg]"]

Peter




More information about the interchange-users mailing list