[ic] bug in 4.0.4a "sub log" ?

Bill Randle billr@exgate.tek.com
Tue, 19 Dec 2000 09:25:11 -0800


Murray Gibbins wrote:
> 
> This is a bit obscure so please read carefully.
> 
> Redhat 7.0
> Perl v5.6.0 built for i386-linux
> minivend-4.04a-2 rpm
> 
> I belive there to be a bug in Interpolate.pm about line 1742 in sub log.
> 
> Here's why...
> 
> This line -
> 
> [tag op=log file=etc/sales.log interpolate=1]wibble[/tag]
> 
> is in a report file that is used for an email report at the end of the purchase.
> The line above returns a "1" to the top of the page ie...
> 
> Subject: ORDER 000008
>   Date:Tue, 19 Dec 2000 13:56:08 GMT
>   From: Minivend server <minivend@handle.scotweb.ltd.uk>
>  Reply-To:shopping@scotweb.ltd.uk
>       To:  murray@scotweb.ltd.uk
> 
> three
> 
> test4
> 1
> test5four
> 
> **************************************************************************
>  This order came via Scotweb.
> 
> etc
> 
> How do I know that it's this sub not any other well I added a line just before
> the return at the end of the sub
> 
> $status = "wib2";
> 
> and it appeared instead of the "1" in my email.
> 
> test4
> wib2
> test5four
> 
> The sub "log" seems only to not return "1" when $opt->{hide} is true!
> In what case is $opt->{hide} true?
> 
> And lastly is this (bug?) in newer versions of interchange?
> 
> Comments please I need this sorted soon.
> 
> Or am i barking up the wronge tree here?

Murray,

It would appear to me you're barking up the wrong tree and that [log] is
working exactly as it is supposed to. Use "hide=1" if you don't want to
see the status.

The purpose os returning the status info (if hide is not set) is so you
can tell if the stuff you're logging was successfully saved to the logfile.
If, for instance, the write to the logfile failed dues to wrong file
permissions, file system full, etc., you would get back a 0. Your MV
tags could then check that and do whatever is necessary.

E.g.:
	[seti logok][log file=etc/sales.log interpolate=1]wibble[/log][/seti]
	[if scratch logok]
	[else]
	  [email ...]failed to write to logfile![/email]
	[/else]
	[/if]


	-Bill