#2123·liquid

`{% cycle %}` with an unquoted variable as its first argument never advances

Author: Nuhiat-ArefinCreated Sep 23, 2026Updated Sep 23, 2026

{% cycle %} with an unquoted variable as its first argument never advances

Version

  • liquid 5.14.0 (4e39ae4cc3da73921923c0669e0fc84a66b2f696)
  • Ruby 4.0.6, x86_64-linux

Steps to reproduce

ruby
require "liquid"

puts Liquid::Template.parse("{%cycle a,'b'%}{%cycle a,'b'%}{%cycle a,'b'%}").render.inspect
puts Liquid::Template.parse("{%cycle 'a','b'%}{%cycle 'a','b'%}").render.inspect

Actual behavior

"\n"
"ab\n"

With a variable as the first argument, the tag outputs the variable's value (undefined a → "") on every call and never advances to 'b'. With literals it cycles correctly.

Expected behavior

The variable form should cycle through its values (as Python Liquid does: two calls produce "" then "b"), or at minimum advance the cycle state. Observed behavior looks like the first variable is being treated as a cycle group name that is never updated.

Impact

Silent output divergence for {% cycle %} tags whose first value is a variable rather than a literal or an explicit group: name.