[ic] one store gone nuts - OMG it works

Kevin Walsh kevin at cursor.biz
Sun Sep 9 19:12:54 EDT 2007


"Glenn McCalley" <techlist at bnetmd.net> wrote:
> > Kevin Walsh <kevin at cursor.biz> wrote:
> > > "Glenn McCalley" <techlist at bnetmd.net> wrote:
> > > > [if type=explicit compare=|
> > > > [calc]Debug('creating user loc 1');[/calc]
> > > > [userdb
> > > > function=new_account
> > > > assign_username=1
> > > > password='[value zip]'
> > > > verify='[value zip]'
> > > > ]
> > > > |]
> > > Change that code so that the [calc] block looks like this:
> > >
> > >     [calc]Debug('creating user loc 1'); undef;[/calc]
> > >
> > > Seeing the code always helps. :-)
> > >
> > Better still, put the [calc] block outside of the [if] tag's compare
> > parameter.  Perhaps on the line above.
> >
> Understand, that was the purpose of putting it in there to see if that 
> branch was being taken.  ...BUT...
> ...OMG...
> I moved it outside and the problem went away...
> Does this mean - no can't be can it - having that debug statement in there 
> was causing this thing to throw a data exception?
>
Yes - The Debug() statement was returning 1, so the "explicit" Perl code
that the [if] tag was being asked to evaluate was "1\n1".  That's "1"
from the Debug() call, returned by the [calc], "\n" (line feed) from
the comparison code and "1" from [userdb].

I've patched Interchange's Vend::Util module to prevent the Debug()
statement from returning a value.  This will help prevent future
debug-related "gotchas".  The patch can be found here, if you want to
apply it to your current setup:

    http://www.icdevgroup.org/pipermail/interchange-cvs/2007-September/007254.html

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin at cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/


More information about the interchange-users mailing list