SOLVED: Empty terms are not excluded from loop request

Bricks Version: 1.4

Hi,

When using a term request, it seems empty terms are displayed although they shouldn’t by default.

The “Show empty” has no effect.

Tested with Uncategorized on screenshot, but same issue with standard empty terms.

Hi Yan,
Thanks again for your report!

I was able to reproduce the issue and added it to our bug tracker.

Best regards,
timmse

Hello @yankiara

It seems this is a WP 6.0 bug. It affects Bricks and not other themes because Bricks performs twice the same query, and the second time, the query results come from the cache, which contains the empty terms.

Bug reported here: #55908 (performing two identical actions in sequence produces different results) – WordPress Trac

2 Likes

Hi Luis,
Thanks for the update :slight_smile:

Out of curiosity, why twice the same query?

Hello @yankiara

Good question :slight_smile:

We loop twice, one to build the HTML and another to build the styles. We might have room for improvement on this logic, and it might have positive performance impacts on the posts query type. :rocket:

1 Like

Yes please optimize this :slight_smile:

3 Likes

Hi Yan,
The issue has been fixed with Bricks 1.5beta.
Please let us know if you still encounter any problems :v:

Best regards,
timmse

1 Like

@luistinygod Is the query made twice or once now? Also what exactly is cached in query loop setting in Bricks options?