Bug with If: Else tag parsing

All notes and input on 2.0 Development are herein. <ul><li>Feature requests</li>
<li>Bug Reports</li>
<li>Beta Testing Feedback</li>
<li>Open Dev Discussion</li></ul>

Moderator: Coranto Moderator Team

Bug with If: Else tag parsing

Postby kriko » Tue Oct 28, 2003 8:20 pm

Hey,

I have seen this one occour two times, this time it was on Coranto Factory with Coranto 1.22.1 installed.

Basically, the input code in style:
Code: Select all
<If: Field: Category eq "faq">Answer
<If: Else: Field: Category eq "tutorials">Tutorial
<If: Else: Field: Category eq "tips_and_tricks">Information
<If: Else>Information
</If>


The output after build (yes I copied it correctly):
Code: Select all
Answer
<If: Else: Field: Category eq tutorials>Tutorial
<If: Else: Field: Category eq tips_and_tricks>Information


I got around it by this code:
Code: Select all
<PerlCode>
   if($Category eq "faq")             { $temp = "Answer";      }
elsif($Category eq "tutorials")       { $temp = "Tutorial";    }
elsif($Category eq "tips_and_tricks") { $temp = "Information"; }
else                                  { $temp = "Information"; }
</PerlCode><Field: temp>


So, um, what ya think?!
Kristjan aka. kriko
now a wireless expert
User avatar
kriko
 
Posts: 3328
Joined: Sat Feb 24, 2007 8:13 pm

Postby Parahead » Tue Oct 28, 2003 8:56 pm

I have noticed this too...

Probably a messed up regular expression... I planned to dig deeper into this earlier when I first saw it but then life got in it´s way and I forgott about it. Maybe time to dig some now instead... ;-)
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby Parahead » Tue Nov 04, 2003 8:31 pm

Okidoki, I did some digging and came up with the reason why this is happening, it was a small typo (or really a cut-and-past error) affecting quite a lot of the <If: Else: > statements...

The If-statements that are affected by this bug are the following:
<If: Else: Field: Name eq 'something'>
<If: Else: Field: Name{"key"} eq 'something'>
<If: Else: Sub: Name eq 'something'>
<If: Else: Field: Name == something>
<If: Else: Field: Name{"key"} == something>
<If: Else: Sub: Name == something>

Anyway, on to the solution.... Using version 1.22.1 as reference, in cradmin.pl line 1938:
Code: Select all
   $style =~ s/<If: Else:\ Sub:\

should be:
Code: Select all
   $style =~ s/<If:\ Else:\ Sub:\


It is a \ missing right after the "If:"-part. The same error can be found at line 1946, 1954, 1962, 1970 and 1978... Cerberos and Lawrence, could you please fix this to the next release?
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby Lawrence » Sun Nov 09, 2003 3:10 am

Fixed in 1.23 :)
Stuff I'm working on:
- nothing

Addons:
http://sourceforge.net/projects/lw-craddons/
Lawrence
 
Posts: 1524
Joined: Sun Sep 16, 2001 4:24 am

Postby InSAnE NiNjA » Sun Nov 09, 2003 8:46 am

....

1.22.3
..nuttier then a squirrel turd..
User avatar
InSAnE NiNjA
 
Posts: 1213
Joined: Sat Jan 25, 2003 6:35 am

Postby kriko » Sun Nov 09, 2003 9:16 am

InSAnE NiNjA wrote:....

1.22.3

eh?

current release is 1.22.1, so logically you might have said 1.22.2, but since Lawrence is working on a new release named Coranto 1.23 his post was correct ;)
Kristjan aka. kriko
now a wireless expert
User avatar
kriko
 
Posts: 3328
Joined: Sat Feb 24, 2007 8:13 pm


Return to Coranto 2.0 Development

Who is online

Users browsing this forum: No registered users and 0 guests

cron