Closed GoogleCodeExporter closed 8 years ago
I can't reproduce this problem:
4> erlydtl:compile(<<"{% if m.rsc[id].o.related %}yep{%else%}nop{%endif%}">>,
t, z_context:new(default)).
{ok,t}
5> t:render([{id, 1}], z_context:new(default)).
{ok,[[<<"nop">>]]}
Original comment by ma...@pobox.com
on 24 Aug 2010 at 7:26
After further tests the problem turns out to be that the following expression
evaluates wrongly iff the related list is empty.
{% print m.rsc[id].o.related and 1 %}
Original comment by ma...@pobox.com
on 25 Aug 2010 at 11:06
Added {rsc_list,[]} to z_convert:to_bool/1 as a 'false' value.
Changed behaviour of the string value "false" when converted to a boolean, now
the string value "false" will evaluate to the boolean value 'false'. Changed
unit tests accordingly.
Fixed in r98b2541592
Original comment by ma...@pobox.com
on 25 Aug 2010 at 12:28
Original issue reported on code.google.com by
scherpenisse
on 24 Aug 2010 at 7:17