Item12929: EasyMacroPlugin incorrectly passes parameters with number 0
Priority: Normal
Current State: Closed
Released In: n/a
Target Release: n/a
Suppose I register a macro %FOO with
EasyMacroPlugin and pass it the number zero:
%FOO{bar="0"}%
then parameter
bar
becomes an empty string.
I think the problem is here:
http://trac.foswiki.org/browser/trunk/EasyMacroPlugin/lib/Foswiki/Plugins/EasyMacroPlugin.pm#L130
Would you like me to check in a fix?
--
MichaelTempest - 31 May 2014
Michael, Somehow this task overlayed
WebHome. I reverted that change and created this task for you.
--
GeorgeClark - 31 May 2014
Thanks, George. For reference, I was using Opera Mini.
--
MichaelTempest - 01 Jun 2014
Hot fix:
@@ -127,7 +127,8 @@
if $key eq $Foswiki::Attrs::ERRORKEY
|| $key eq $Foswiki::Attrs::RAWKEY
|| $key eq $Foswiki::Attrs::DEFAULTKEY;
- my $val = $$innerParams{$key} || '';
+ my $val = $$innerParams{$key};
+ $val = '' unless defined $val;
--
MichaelDaum - 02 Jun 2014
Thank you, Michael. That is exactly the change I had made locally. And yes, that fix works.
--
MichaelTempest - 02 Jun 2014