You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we should return the corresponding assigned object
Current Behavior
Since upgrade from 3.x to 4.0, I no longer return an object if the value is a number. ("where_exp" does work, so does a "where" filter with a string value).
Code Sample
Assume an "orgs" collection, containing hr.md with deptid: 2765 and in some site template I only want to pull data about the HR department: {%- assign dept = site.orgs | where: "deptid", 2765 | first -%}
{{ dept.other_metadata }} returns relevant data in 3.x, nothing in 4.0.
these would work however:
{%- assign dept = site.orgs | where: "deptid", "hr" | first -%}
if hr.md's id == "hr" instead; success.
{%- assign dept = site.orgs | where_exp: "dept", "dept.deptid == 2765" | first -%}
where_exp with INT; also success.
Maybe this is just a change in the latest liquid, either way might be worth documentation for migrations.
The text was updated successfully, but these errors were encountered:
@whicks1 Thanks for reporting this! I ran into the same issue but hadn't gotten a chance to write up what was going on. (And I ended up switching to using where_exp as a workaround…)
jekyll doctor
to check my configurationMy Environment
jekyll
github-pages
Expected Behaviour
we should return the corresponding assigned object
Current Behavior
Since upgrade from 3.x to 4.0, I no longer return an object if the value is a number. ("where_exp" does work, so does a "where" filter with a string value).
Code Sample
Assume an "orgs" collection, containing hr.md with
deptid: 2765
and in some site template I only want to pull data about the HR department:{%- assign dept = site.orgs | where: "deptid", 2765 | first -%}
{{ dept.other_metadata }}
returns relevant data in 3.x, nothing in 4.0.these would work however:
{%- assign dept = site.orgs | where: "deptid", "hr" | first -%}
if hr.md's id == "hr" instead; success.
{%- assign dept = site.orgs | where_exp: "dept", "dept.deptid == 2765" | first -%}
where_exp with INT; also success.
Maybe this is just a change in the latest liquid, either way might be worth documentation for migrations.
The text was updated successfully, but these errors were encountered: