Item12893: Nested DEFAULT default Macro parameter expansion
Priority: Normal
Current State: Closed
Released In: 2.0.0
Target Release: major
Applies To: Engine
Component:
Branches: trunk
CASE 1
- Set Test = "%arg{default="%DEFAULT{default="Y"}%"}%"
%Test%%BR%
%Test{"X"}%%BR%
%Test{arg="X"}%%BR%
What I would expect:
"Y"
"X"
"X"
What I'm getting:
"Y"
"X"
"Y"
My guess is that the
default
from the fragment:
%DEFAULT{default="Y"
is being picked up and used to satisfy the:
%arg{default=
--
JohnHart - 08 May 2014
You were almost right, but it was a little bit more complicated than that. What was happening was the code that is supposed to handle the inner expansion of a preference was not handling the default= parameter to the DEFAULT tag correctly, and it would not handle this corner case correctly. I fixed it in the 1.2.0 codebase.
Glad that someone is pushing this code; it's the only way we find this sort of problem.
--
CrawfordCurrie - 09 May 2014
Very cool - thanks - my first tiny contribution - BTW {I neglected to mention this in my orginal post) inverting the nesting produces a variation of this behavior (my suspicion is that the fix you've already made covers this alternate case)
CASE 2
- Set Test = "%DEFAULT{default="%arg{default="Y"}%"}%"
%Test%%BR%
%Test{"X"}%%BR%
%Test{arg="X"}%%BR%
What I would expect:
"Y"
"X"
"X"
What I'm getting:
"Y"
"Y"
"X"
--
JohnHart - 09 May 2014