Theme Settings > Arithmetic Liquid Errors

Ceri-Waters
Shopify Partner
68 4 11

Hi Shopify,

For the last 2 days we've had inconsistent Liquid Errors throwing over some logic that has been in place for over a year without error. This has happened on multiple Shopify Stores too.

We're retrieving a value from the Theme Settings e.g.

{%- assign totalMonths = settings[totalMonthsSetting| plus: 0 -%}

 

And performing some arithmetic tasks such as dividing, and comparing values. The problem is we're now getting Liquid errors every so often, such as "comparison of string with 0 failed", or "cannot divide by 0". The thing is the totalMonths setting is not a string (since we force it by adding 0), nor a value of 0 it's e.g. 9. My theory is the theme setting is failing to be retrieved every so often?

As previously mentioned this liquid code has been working fine for over a year, and the theme settings haven't changed.

Has something changed within Shopify?

Thanks,
Ceri.

0 Likes