Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Collection tag flawed. Maybe deeper Antlers/Syntax issues? #3097

@felixstoessel

Description

@felixstoessel

Bug Description

Very weird things happen with my collection tag.

{{ collection from="faq" limit="3"
  faq_categories:contains="{faq_categories:0:id}"
  :id:isnt="id"
  sort="random"
}}

When I change it to:

{{ collection from="faq" limit="3"
  faq_categories:contains="{faq_categories:0:id}"
  :id:isnt="id"
  sort="{{ randomizer ? 'random' : 'order' }}"
}}

I get

Facade\Ignition\Exceptions\ViewExceptionWithSolution
Modifier [from] not found
The from modifier was not found.

For more weirder things: When I change it to (linebreak before 'from='):

{{ collection
  from="faq" limit="3"
  faq_categories:contains="{faq_categories:0:id}"
  :id:isnt="id"
  sort="{{ more ? 'random' : 'order' }}"
}}

I get my entries, but they are from a completely different collection. Seems something really flawed with Antlers?

Environment

Statamic 3.0.38 Solo
Laravel 8.21.0
PHP 7.4.10

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions