Skip Menu |
 

This queue is for tickets about the Text-MicroMason CPAN distribution.

Report information
The Basics
Id: 18435
Status: resolved
Priority: 0/
Queue: Text-MicroMason

People
Owner: FERRENCY [...] cpan.org
Requestors: Dan [...] DWright.Org
Cc: alan [...] pair.com
AdminCc:

Bug Information
Severity: Critical
Broken in: 1.992
Fixed in: (no value)



CC: alan [...] pair.com
Subject: Recent filter feature breaks expresions that use logical or: '||'
Download (untitled) / with headers
text/plain 478b
The recent addition to Text::MicroMason, which permits filters to be added to the end of <% %> blocks, has caused expressions inside templates such as this to break: <% $foo || 0 %> The problem is that MicroMason is seeing the '| 0' at the end of the string and ignoring its context. I have attached a diff to the 33-filters.t test file, which demonstrates this failure condition. Also attached is a diff for Text::MicroMason::Filters, which I believe corrects this bug.
Subject: 33-filters.t.diff
Download 33-filters.t.diff
text/x-diff 242b
14a15,23 > # Test an expression inside a template using logical or. > > { > my $src = q(Var is <% $ARGS{foo} || 0 %>); > > $m->execute( text => $src ); > } > > ######################################################################
Subject: Filters.pm.diff
Download Filters.pm.diff
text/x-diff 181b
34c34 < my $filt_flags = ($token =~ s/\|\s*(\w+(?:[\s\,]+\w+)*)\s*\z//) ? $1 : ''; --- > my $filt_flags = ($token =~ s/[^\|]\|\s*(\w+(?:[\s\,]+\w+)*)\s*\z//) ? $1 : '';
Download (untitled) / with headers
text/plain 101b
This should be fixed in developer version 1.993_01. Please respond if you have any other problems.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.