[ic] if explicit problem with data tag (SOLVED)

Rick Bragg lists at gmnet.net
Sat Nov 21 23:08:03 UTC 2009


On Sat, 2009-11-21 at 12:28 -0800, Daniel Browning wrote:
> On Saturday 21 November 2009 11:36:56 am Rick Bragg wrote:
> > [if type=explicit compare="$Tag->data({ table => groups
> >     column => description,  key => [data session arg], })"] ...
> > Any ideas what the problem is?  
> 
> Here is what I suggest as a replacement:
> 
> [if type=data term="groups::description::[data session arg]"]
> 
> If you're curious why the first version didn't work, there are several 
> reasons. When you pass perl to a usertag, it helps to try executing that 
> perl by itself first to check for problems, like so:
> 
> [perl]
>     return $Tag->data(
>         { 
>             table => groups 
>             column => description, 
>             key => [data session arg], 
>         }
>     );
> [/perl]
> 
> That will show you the syntax errors (missing comma, unquoted literals, 
> table access). Here is the fixed code:
> 
> [perl tables="groups"]
>     return $Tag->data(
>         { 
>             table => 'groups',
>             column => 'description', 
>             key => q{[data session arg]}, 
>         }
>     );
> [/perl]
> 
> Then you could package that up and put it back in the compare="" clause, if 
> you could not use this shorter version for some reason:
> 
> [if type=data term="groups::description::[data session arg]"]
> 
> HTH,
> --
> Daniel Browning
> End Point Corporation
> http://www.endpoint.com/
> 

Yes Dan that did Help!

My first try was:
[if type=data term=groups::description::[scratch test]] (no quotes) 
That did not work, so I went to the perl thing, but now with:
[if type=data term="groups::description::[scratch test]"]
things work perfect.

Thanks
Rick





-- 
This message has been scanned for viruses and
dangerous content by Green Mountain Network, and is
believed to be clean.




More information about the interchange-users mailing list