locomotivecms / steam

The rendering stack used by both Wagon and Station (new name of the engine). It includes the rack stack and the liquid drops/filters/tags.
MIT License
38 stars 59 forks source link

allEntries doesn't work with "created_at" #208

Open greyskin opened 2 years ago

greyskin commented 2 years ago

I'm a little unsure if Steam is the correct repository for this issue - my apologies if it isn't.

The Locomotive CMS docs used to contain the following example for filtering on a Liquid action:

{% action "get all entries" %}
    var entries = allEntries('[content_type_slug]', { 'created_at.lte': getProp('now') });
    setProp('entries', entries);
{% endaction %}

{% for entry in entries %}
    {{ entry._slug }}
{% endfor %}

The above should render a list of all entry slugs (lte = "less than or equal to"). It does not.

I have tested extensively with created_at variations, including hard coded dates, ISO formats, etc. I have been unable to get anything to render whatsoever, when passing any created_at filters.

The above example has been removed from the docs at my suggestion to reduce confusion (as I spent many hours trying to get this to work thinking because it was in the docs I must be doing something wrong.)

Currently the only workaround I have found is to use {% with_scope created_at... %}. This becomes problematic when working with the Actions API.