SOLVED: Query are not execute in Archive template

Bricks Version: 1.4
Browser: Chrome 90

Hi, I have created a section template that contains a series of queries that work perfectly in all page site except in the archives template … how is that possible?

here are the working query
http://marcog146.sg-host.com
while at follow address you can see the same template with query issue…
http://marcog146.sg-host.com/politica/

Hi Paulo,
Thanks so much for your report!

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

Best regards,
timmse

1 Like

it also happens in search result templates.
Unlike other bugs that I have reported that can be patched and a temporary and alternative solution, this one is pretty serious. Can it be fixed within a couple of weeks? I have to deliver a project ;(

@ninmorfeo Are these Bricks’s query loop queries or you have queries snippet in the code blocks?

1 Like

it’s brick’s query loop,

I guess you will have to resort to manual query via the code block for now. An update is expected at the end of this month but not sure if there will be a fix for this.

Hey @ninmorfeo, @omega ,

Do you still have this issue on 1.5-beta?

Please let me know as I’m not able to reproduce this anymore.

Thank you.

No it didn’t solve … I also tried to delete all the plugins … there is no way
the strange thing is that inside the editor the query is rendered, but when I see it in the frontend nothing appears

Hello @ninmorfeo

As far as I can understand this scenario, you created a section template, where you added one loop container with some query (Query 1). Then you added this template in one archive template using the template element.

I’m suspecting that when you visit the archive page, say /category/projects (example) the Query 1 (from the section template) will be automatically merged with the main query of the archive page (category = projects) which in combination with what you set in the Query 1, gives no results.

If this is the case, the only possible solution is to use the hook “bricks/posts/merge_query” and return false, to avoid the merge of query 1 with the main archive query.

So, go to this academy article (Filter: bricks/posts/merge_query – Bricks Academy) and adapt the example to your own case. You would like to prevent the Query 1 to be merged with the main query. Add the code snippet to your child theme, and see if it fixes the issue.

Thank you
Luis

1 Like

you right…now it’s work. Thanks :slight_smile:

1 Like

Hi Paolo,
Now I can finally mark the report as solved :slight_smile:
We’ve fixed this bug in Bricks 1.7.1, now available as a one-click update in your WordPress Dashboard.

Please let us know if you are still experiencing issues.

Best regards,
timmse

1 Like

great, its ok now :slight_smile: