Hi @MarekKmiecik ,
The $settings['options']
should be a pure string.
I just tried your steps, and I can replicate the issue when using the replace media function from the Enable Media Replace plugin.
However, this is not a bug from Bricks. The Bricks post meta was modified by the plugin.
I believe this is their plugin logic:
- When media is replaced, the plugin queries all meta values from the entire website that contain the replaced media URL/ID. It then performs some replacement logic and updates the meta values.
- Unfortunately, their replacement logic causes Bricks data stored in
_bricks_page_content_2
to become corrupted. The string is converted to an object, resulting in the PHP error you encountered.
You can experiment with this to prove that this issue is not related to Bricks. Here are the steps:
-
Create a nested slider using your custom options.
-
Add an image to the slide and save.
-
Get a copy of the
_bricks_page_content_2
value from thepostmeta
table wherepost_id
is equal to your slider page. You should be able to see your saved data like this:
-
Switch the theme to the default WP theme (Twenty Twenty-Four).
-
Replace the image in the Media Library using the Enable Media Replace plugin (use the same image you uploaded earlier).
-
Check the
meta_value
again; it should be converted like this by the plugin:
As you can see, during the replacement process, the logic that updates the meta_value
is controlled by the Enable Media Replace plugin.
Hence, I would suggest you reach out to their support to solve this issue.
I hope this explanation makes sense.
Regards,
Jenn