SOLVED: Query Results Count not working in Components - but takes results from inactive template

Browser: FF 142.0.1
OS: Windows 11

Really, really weird problem. So, I can’t get query results count to return a correct result. Here’s what’s happening:

I’ve got an old section template that contains a query. I copied the entire section to a fresh page, converted it into a component, and it runs - except the query results count always returns 0. No matter what I do, the results are zero:

Here’s the code for it:
Results vsisnb: {query_results_count:vsisnb}
Results 03b798: {query_results_count:03b798}

The vsisnb is the id of the new query. The query works, it returns results just fine and shows content.

However, the 03b798 is what the query was called before I copied it and converted it into a component - it is the query from a template that was never part of the page I’m working on. And yet, it displays the query results. (The template still exists among my templates, but it shouldn’t be loaded if its never been part of the page.)

So my thoughts are that there’s a mismatch somewhere, that the query itself thinks its got a different name from the name it displays. Either that, or there are gremlins that live inside my computer.

Take your pick…

Hi Filip,
Thanks so much for your report!

I can replicate the query_results_count issue showing 0 and have added it to the internal bug tracker. We will update this thread as soon as it is fixed.

It doesn’t matter whether the query is on the page or not—it exists anyway.

Best regards,
timmse

This fixed? Seems to be similar to my issue: Global/Query not working in component?

When bugs are fixed the heading typically changes from WIP (work in progress) to SOLVED. This one still says WIP.

3 Likes

Yesterday I created this ticket regarding Components and Query Results Count: DUPLICATE: Query_results_count does not work inside Component

I thought my issue was fixed but it turns out it was not.

I can get the query count to work in one component instance but the count in all future components will count the query results of the first component. So the query count unfortunately is not correct in all others.

Hi @timmse,
could you give some insight here? It would come very handy if this issue would be fixed soon because it would make a current project much easier.

The fix has been merged internally. We will update this thread once the fix is included in a public release.

1 Like

We’ve addressed this in Bricks 2.3.8, now available as a one-click update in your WordPress Dashboard.

Please read the changelog entry before updating, and let us know if you experience any issues.

1 Like