The presence of a $m->flush_buffer statement in a lower level component
causes the <%filter> section in a higher level component to be bypassed.
Here is a very simple way to reproduce this bug.
Put both the attached files ("index.html" and "autohandler") in a Mason dir.
index.html simply contains:
-----------------------------------
First chunk from index.html
% $m->flush_buffer;
Second chunk from index.html
-----------------------------------
and autohandler simply contains:
-----------------------------------
% $m->call_next;
<%filter>
s/First chunk from index.html/*First chunk seen by autohandler!* - /;
s/Second chunk from index.html/*Second chunk seen by autohandler!*/;
</%filter>
-----------------------------------
Now try to access index.html from your browser and you'll see:
First chunk from index.html *Second chunk seen by autohandler!*
instead of the expected output:
*First chunk seen by autohandler!* - *Second chunk seen by autohandler!*
Now comment out $m->flush_buffer; in index.html and you'll get the above
mentioned expected output (so this confirms that the problem is caused
by $m->flush_buffer).
This bug was *not* present in HTML-Mason-1.32 (where you got exactly the
expected output), so there is a possibility that it was introduced in
HTML-Mason-1.33 by this somewhat related fix:
1.33 May 28, 2006
[ BUG FIXES ]
- If $m->flush_buffer() was called when there was a filter somewhere
in the component chain, the flush did nothing. Task id #596.
The above mentioned tests have been executed in the following environment:
Mac OS X 10.4.8
perl 5.8.8
Apache 2.0.2
mod_perl 2.0.2
HTML::Mason 1.32, 1.33, 1.34, 1.35
Cheers,
Emanuele Zeppieri.