Metabox <> Bricks fatal error

I am getting a fatal error and below written by Claude:

I’m getting a fatal error on the frontend when Bricks renders a popup on single post pages.

Error:

PHP Fatal error: Uncaught TypeError: array_values(): Argument #1 ($array) must

be of type array, string given in /wp-content/themes/bricks/includes/integration

s/dynamic-data/providers/provider-metabox.php:232

Stack trace summary:

The error originates in Provider_Metabox->get_tag_value() at line 232, called

via the dynamic data rendering chain during popup rendering

(Popups::render_popups() → Frontend::render_data() → Frontend::render_element()

→ conditions check → render_dynamic_data() → Provider_Metabox->get_tag_value()).

The call to array_values() on line 232 receives a string instead of an array. It

looks like the MetaBox field value isn’t being type-checked before being passed

to array_values().

Context:

  • The error occurs on single.php pages during wp_footer() when popups are rendered - I’m using MetaBox for custom fields

  • PHP 8.1+

A simple fix would be wrapping the value in an is_array() check before calling

array_values() on line 232.

Hi Yasmine,

Could you please let me know how to replicate this issue? Specifically, I need to know which Metabox custom field I need to set and how to call it.

Ideally, if you could record a step-by-step video, that would be extremely helpful.

Thanks,
Matej