lucidnz / bootstrapify-1

An open-source base theme for Shopify using Twitter Bootstrap
http://bootstrapify-theme.myshopify.com/
187 stars 72 forks source link

liquid error: invalid integer #234

Closed ajmalafif closed 9 years ago

ajmalafif commented 9 years ago

hey all,

I'm getting liquid error: invalid integer on sliders. Could be Shopify's changing something to liquid and affecting it. Sitting through it, will share solution if i found first.

Thanks.

MicrobrewMedia commented 9 years ago

@ajmalafif I have the same issue! Just noticed it today. I've been looking for 3 hours! I'll do the same.

MicrobrewMedia commented 9 years ago

@ajmalafif Potentially the commit by @Shopify as shown here? https://github.com/Shopify/liquid/commit/9c9345869bfc69894fad500347656cd8ecd95306

dylanahsmith commented 9 years ago

Potentially the commit by Shopify as shown here? Shopify/liquid@9c93458

That hasn't been deployed to Shopify yet, and doesn't seem relevant to your error.

cc @pushrax this could be related to pull request https://github.com/Shopify/liquid/pull/616

MicrobrewMedia commented 9 years ago

@dylanahsmith thanks for the correction.

dylanahsmith commented 9 years ago

The key difference is that non-integers are converted to integers using Integer(input.to_s) instead of input.to_i so perhaps you are trying to use nil as part of a range.

ajmalafif commented 9 years ago

@MicrobrewMedia

Ouch! So far I'm dumbfounded for like 1 hour. Hopefully one of us found a solution soon!

dylanahsmith commented 9 years ago

It looks like you are doing things like {% for i in (i..5) %} which looks suspect (https://github.com/luciddesign/bootstrapify/blob/63e7492f4660bb0dad2ffde26b1b3be2b0a7feed/theme/assets/_base.scss.liquid#L9305). I'm guessing i hasn't been assigned a value before lines like that.

dylanahsmith commented 9 years ago

git grep -n '{% for i in (i..'

dist/scss/bootstrapify_overrides.scss.liquid:1058:{% for i in (i..5) %}
theme/assets/_base.scss.liquid:9305:{% for i in (i..5) %}
theme/assets/_settings.scss.liquid:92:{% for i in (i..5) %}
theme/snippets/footer.liquid:5:      {% for i in (i..3) %}
theme/snippets/slider-static-slider.liquid:1:{% for i in (i..4) %}
MicrobrewMedia commented 9 years ago

@dylanahsmith I can confirm I know I've seen those while making my site from this theme. Make sense why the SCSS.liquid is messed.

MicrobrewMedia commented 9 years ago

I wonder if @stewartknapman or @galenking can share how their site on Gearshop is living currently in regards to those files? Thanks!

pushrax commented 9 years ago

Theoretically prior to this change, affected pages would have been getting a 500 error. (a Ruby NoMethodError for to_i instead of Liquid::ArgumentError)

edit: actually, "asdf".to_i == 0, but Integer("asdf") => ArgumentError, that is probably the issue.

pushrax commented 9 years ago

Fix is in Liquid here: https://github.com/Shopify/liquid/pull/620, this will go out in Shopify very soon. Sorry!

pushrax commented 9 years ago

Everything should be good now, please let me know if you are still experiencing any errors.

MicrobrewMedia commented 9 years ago

@pushrax still dead on my end. Sent you an Email with site.

pushrax commented 9 years ago

@MicrobrewMedia you probably have the page cached in your browser – I'm not seeing the error on your shop on my end. Try ctrl-shift-r or cmd-shift-r depending on your browser/os to refresh the page ignoring your cache.

stewartknapman commented 9 years ago

Wait, so is everyone good now?

pushrax commented 9 years ago

Yep, the issue has been fixed globally and Shopify's caches flushed. Any remaining cases would be because of local browser caches.

MicrobrewMedia commented 9 years ago

Still Getting on jones-golf-bags.myshopify.com... I've tried multiple Browsers and Cleared them and Gone Incognito ...

stewartknapman commented 9 years ago

Cool, thanks @pushrax

MicrobrewMedia commented 9 years ago

Look good now. Seems Shopify was slowing moving over. Cheers!

pushrax commented 9 years ago

I think what happened for you was that your error was in a CSS Liquid file, which is cached on our CDN differently than the storefront page cache. Sorry for any confusion.

MicrobrewMedia commented 9 years ago

No worries. Thanks Justin! Appreciate everyones help in this.

stewartknapman commented 9 years ago

Ok cool, I'm at work now so I've had a chance to look into this properly, and yea those for loops were just plain whacky.

I've fixed them now.

MicrobrewMedia commented 9 years ago

Awesome.