Shopify / Shopify/liquid

Issue with Reject Array Filter filter when using the Section Rendering API

Open
#1,912 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Report
Dominant language
Ruby
Stars
11.9k
Forks
1.5k
Avg merge
17h 55m
Merged PRs (30d)
3

Description

Hi everyone,

I am trying to use the new | reject filter for arrays. It works fine when the page is rendered normally (even though theme-check still considers it an unknown filter). However, when I fetch the same section using the Section Rendering API, it returns an error.

Liquid Code:
{% assign final_actives_promos = final_actives_promos | reject: 'display_name', promo.display_name %}

Error Message:
Liquid syntax error (snippets/cart-drawer line 53): Expected end_of_string but found dash in "{{final_actives_promos -check-: 'display_name', promo.display_name }}"

Has anyone encountered this issue or can provide some insights?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with snippets/cart-drawer line 53 and reproduce the same Liquid code through normal rendering and the Section Rendering API. Compare how the reject filter is parsed in each path; the issue is resolved when the API handles this filter consistently with normal rendering.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.