SOLVED: Query loop on Global elements not working in 1.7.2, works in 1.7.1

There is an issue with Bricks 1.7.2, however it’s not yet clear to me if it’s an issue that needs to be fixed in Bricks or maybe in BricksExtras instead as the issue I’m having is seen in the Dynamic Table element in BricksExtras.

In 1.7.1 it works:

In 1.7.2 it does NOT work:

I’ve rolled back to 1.7.1 and it began working again.

In my case, I’m using dynamic data from Meta Box and the Dynamic Table element from BricksExtras. Cc @wplit in case this is a BricksExtras bug at all.

Recent testing shows this is the result of the element being Global. If I disconnect it from being Global then it loads properly in the frontend.

Worth noting this works fine in the editor no matter what, it’s only an issue in the frontend (another annoyance when these don’t match).

Update for the report. This issue can be replicated with any native elements using query loops in Bricks v1.7.2 also, it’s something reg. query loop itself that has changed.

From my testing… since Bricks v1.7.2 if an element has both a query loop, and is also linked as global, the query loop now no longer will fetch the data from the query.

Steps to replicate…

  • Add a container element to a page and set as query loop to query some posts.
  • Add text element inside and add dynamic tag post_title to show the post titles.
  • View on front, everything will be working, the list of post titles will be visible.
  • Go back into Bricks and with the container, right click and ‘save as global element’.
  • View again on front end, the post data isn’t being fetched from the posts.
1 Like

Perfect, thank you for confirming David. It was EOD for me so I couldn’t finish more testing, im happy you’ve been able to confirm this happens in native elements too not just BricksExtras. I’ve edited the post title to reflect that now too.

This seems like a rather large defect in Bricks 1.7.2, I’m surprised this wasn’t caught in QA. :frowning: Hopefully this will be fixed for the next release.

@timmse or @itchycode - just want to bring this one to your attention as it seems like a rather large defect. I hope this can be resolved in the next release. For now I’ve rolled back to 1.7.1 temporarily but let me know if you require access at all and I can upgrade again for you.

Hi @d19dotca ,

Thanks for bringing up this topic.
As per my understanding, Global element for layout type elements (container, div, block) with query loop is not supported.
It is not working either if you are in 1.7.1
In 1.7.2, it is a bug fix for this as the query loop on a global element will cause PHP infinite loop and exhaust the memory as well.

You could do a test in 1.7.1 or older version, whenever set the query loop on a global layout type element, your page will get a PHP error or white screen in frontend.

Regards,
Jenn

Hi Jenn,

That’s not been my experience, but I am also not using a layout element but the Dynamic Table element in BricksExtras. @wplit had confirmed this issue in non-BricksExtras elements as well. Are you suggesting them that using global element query loops even in non-Bricks layout elements are also no longer supported?

I had no such issue in 1.7.1 or 1.7.0 for example which is why I mentioned that I had rolled back to 1.7.1 where it works perfectly fine for me. You can see this on my staging site, the homepage and Events page show the global element query loop in the dynamic table element which are working well in 1.7.1. In 1.7.2 however they fail to load any results.

If query loops on global elements aren’t meant to work, I’d suggest this be made more obvious in the UI somehow at the very least. It’s not mentioned here at all for example either: Query Loop – Bricks Academy

But I’m still hesitant to believe this is intended behaviour at this time with my current situation.

@wplit - does this response from @itchycode mean we need a bug fix in the Dynamic Table element in BricksExtras instead perhaps if this is indeed intended behaviour from Bricks now?

the query loop on a global element will cause PHP infinite loop and exhaust the memory as well.

it means query loops can no longer be global elements (to prevent the memory issue by the sounds of it). it’s not just layout elements, it’s true for the native ‘Accordion’ element also, any element using a query loop.

Hi @itchycode,

This is a very unfortunate limitation if accurate (and I’m surprised this didn’t get more attention). As @wplit said, this seems to affect more than just layout elements too but the Accordion and Tabs as well. Is there any indication this will be reintroduced?

If it’s true, then this really needs to be noted better for users. I didn’t see any obvious changelog entry for it (though I assume this is the one? Changelog – Bricks), none of which seem to imply that queries are no longer supported with global elements. Additionally there seems to be no notes in the Bricks documentation for the Global Elements or Known Issues lists.

I still want to believe this is not the way this is meant to be and that this is a defect/bug, but if it’s true that this is indeed a functionality that was removed then it almost seems like users would be better off with a Template “Section” although that’s still not ideal either. :frowning: This is disappointing since this was working fine for me with 1.7.1, only changing (breaking IMO) in 1.7.2.

Thanks @d19dotca and input from @wplit ,

We will revisit this topic internally. Yup, noticed that the non layout element like Accordion also not working if it’s a global element.

1 Like

Another vote from me for this functionality … should be working natively by default!

Hi Dustin,

We’ve fixed this issue in Bricks 1.8 beta, now available as a manual download in your account.

Please let us know if you are still experiencing issues.

As with any beta release, please do not use it on any production/live website. It is only meant for testing in a local/staging environment.

Best regards,

timmse

1 Like