sebastienros/fluid

"case" conditional behaves differently

Closed this issue · 3 comments

One of our users came across this and we'd like your input.

In Shopify Liquid a "case" will return multiple expressions if multiple conditions are met. This can happen because a "when" can contain multiple values.

In Fluid the first condition that is true will return the expression and then exit the case in the same manner that a SQL "case" works.

What do you think? We could go either way and are wondering if Shopify Liquid got this one wrong.

Screenshot shows Liquid behavior on the shopify API: https://shopify.dev/api/liquid/tags/case

Thanks in advance!

mgMdxRYlPj

My instinct would tell me to follow Shopify, I will check in their code what is the expected behavior. And if confirmed then we need to fix it in Fluid.

I confirm this is the expected behavior. Also need to change the parser to handle , as a valid separator.

@sebastienros Thanks for the excellence you pour into this library.