Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

|shuffle filter doesn't work #1632

Closed
bobdenotter opened this issue Jul 15, 2020 · 1 comment · Fixed by #1633
Closed

|shuffle filter doesn't work #1632

bobdenotter opened this issue Jul 15, 2020 · 1 comment · Fixed by #1633
Labels
🐛 tag: bug This is a bug.

Comments

@bobdenotter
Copy link
Member

This ought to work:

    {% setcontent pages = "pages" limit 4  %}

    {% for page in pages|shuffle %}
        <li>{{ page.id }} - {{ page|title }}</li>
    {% endfor %}

But, it throws an exception instead:

Schermafbeelding 2020-07-15 om 17 47 30

We should ensure the |shuffle filter works on Pagerfanta objects, as well as regular arrays.

Additionally, check if this also applies to sort, first, last, batch, length (does work, but wrong results), reverse and slice.

@bobdenotter bobdenotter added the 🐛 tag: bug This is a bug. label Jul 15, 2020
@bobdenotter bobdenotter added this to the Bolt 4.0.0 stable milestone Jul 15, 2020
@I-Valchev
Copy link
Member

Afaik, only |length doesn't work. The rest seemed to work fine for me. #1633 fixes length and shuffle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 tag: bug This is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants