reggi / shopify

Just a place to track issues and feature requests that I have for shopify
3 stars 1 forks source link

Linklists "for" assignment is immutable #14

Open reggi opened 9 years ago

reggi commented 9 years ago

I've been working all day and found a bug with shopify here's the simplest code that makes the bug occur. It also exposes some ruby code.

When you loop over a linklist and then assign the for variable to something else it produces an unexpected result. For some reason that link variable is now immutable and I can't change it.

{% for link in linklists["home-page-flexcards"].links %}

  {% assign link = "hello world" %}

  {{ link }}

{% endfor %}

Linklists don't behave like the other objects either they should be wrapped within a LinklistDrop I believe that this would prevent this from happening.

{"title"=>"untitled", "handle"=>"untitled", "url"=>"/pages/subscription", "type"=>"page_link", "active"=>#<Proc:0x007f24b55beab0@/app/app/models/link.rb:71 (lambda)>, "object"=>#<Proc:0x007f24b55be830@/app/app/models/link.rb:73>}