NO BUG: Code in Query Editor producing PHP errors in Bricks Editor but Works fine on the Frontend

It’s in regards to this post I have. You can see this post for the query I used.:

I’ve created a query in the Query Editor. It works fine on the Front End and pulls data from a Meta Box Image Advanced field and displays the images in image elements.

The problem is that when I load the template in the Bricks Editor it shows an error at the top of the page in the Bricks Editor. (it still loads the rest of the page fine)

along with an error in the first image element that the query is being used.

I can edit the page etc fine but the dynamic data it tries to pull in for the query obviously has a problem but only in the Bricks editor (as the front end returns the images from the meta box image advanced field fine in my Bricks Image Elements)

Hi Tom,
Thanks so much for your report!

Would you be so kind as to send temporary login credentials and a link to this thread to help@bricksbuilder.io using the email address you used during the purchase?

Best regards,
timmse

1 Like

Hi @Tom ,

You have to check the variable type before use count()

Inside the builder, the post_id might be using the template post ID itself. So there is a chance that rwmb_meta() returning false.

Regards,
Jenn

Thanks with your code change the section is now loading. How about the error at the top of the page that is not tied to any one section (first image I posted)

Error: Cannot access offset of type string on string

Hi @Tom ,

Thanks for reminding me. Yup, it was the same code as well.
Sent you the enhanced code and all good now :slight_smile:

Regards,
Jenn