Switchee
ExpressionEngine 1.x, ExpressionEngine 2, ExpressionEngine 3, ExpressionEngine 4
Back to this add-on's main page
View Other Add-ons From Mark Croxton
Default case is returned in addition to matched case
Bug Report
travisb
|
Posted: 30 March 2014 06:58 PM |
|
|
|
Hi Mark, Seeing a change in the way default is working after update to Switchee 2.1 (and ee 2.8.1). If the default case is above the matched case both are being returned. If default is last in order, then it works as expected. For example:
{exp:switchee variable="abc" parse="inward" debug="yes"} {case default="yes"}default{/case} {case value="abc"}other{/case} {/exp:switchee}
outputs:
defaultother
Debug shows:
(0.011817 / 5.43MB) Switchee: default case found for variable ‘abc’. This will be returned if no match is found.
(0.011848 / 5.44MB) Switchee: string match: case ‘abc’ matched variable ‘abc’
|
|
|
Mark Croxton
|
Posted: 31 March 2014 09:24 AM |
# 1
|
|
Developer
|
Yes a bug, sorry about that. Fixed now in 2.1.1:
https://github.com/croxton/Switchee
|
|
|
travisb
|
Posted: 31 March 2014 10:42 AM |
# 2
|
|
|
Sweet - thank you!
|
|
|