WAIT: How to fix error after replacing a picture with Enable Media Replace

Bricks Version: 1.6.1
Browser: Chrome
OS: macOS / Windows / Linux / etc.

I have replaced a photo using “Enable Media Replace” from Shortpixel which is placed inside a “Nested Slider” in bricks.

After the replacement, I started to get these error:

Fatal error: Uncaught Error: stripslashes(): Argument #1 ($string) must be of type string, array given
in .../wp-content/themes/bricks/includes/elements/slider-nested.php on line 1022

Call stack:

stripslashes()
wp-content/themes/bricks/includes/elements/slider-nested.php:1022
Bricks\Element_Slider_Nested::render()
wp-content/themes/bricks/includes/elements/base.php:2056
Bricks\Element::init()
wp-content/themes/bricks/includes/frontend.php:441
Bricks\Frontend::render_element()
wp-content/themes/bricks/includes/elements/container.php:839
Bricks\Element_Container::render()
wp-content/themes/bricks/includes/elements/base.php:2056
Bricks\Element::init()
wp-content/themes/bricks/includes/frontend.php:441
Bricks\Frontend::render_element()
wp-content/themes/bricks/includes/elements/container.php:839
Bricks\Element_Container::render()
wp-content/themes/bricks/includes/elements/base.php:2056
Bricks\Element::init()
wp-content/themes/bricks/includes/frontend.php:441
Bricks\Frontend::render_element()
wp-content/themes/bricks/includes/frontend.php:518
Bricks\Frontend::render_data()
wp-content/themes/bricks/includes/frontend.php:805
Bricks\Frontend::render_content()
wp-content/themes/bricks/page.php:7
include()
wp-includes/template-loader.php:106
require_once()
wp-blog-header.php:19
require()
index.php:17

I tried the following but no help:

  • disable the Enable Media Replace plug-in
  • Replace the image in the slider
  • Delete the whole slide
  • Delete the photo permanently

Please Help!

Here is how it appears on bricks editor

I managed to get rid of the error by adding a new “Slider Nested” element, copied style and all children from the old slider, and pasting everything into the new slider. then delete the old slider.

Hope there will be a fix for this issue soon!

Hi Yaya,
Thanks so much for your report, and welcome to the forum!

Unfortunately, I cannot reproduce the issue. Replacing the image works for me without a PHP error.
Which PHP version are you currently using? Can you record a quick screencast showing and explaining what’s going on? That might help in reproducing the issue.

Best regards,
timmse

Thanks for the reply,

My PHP version is 8.0

So I’m using a nested slider with custom options and structured as follow


When I add/replace the image from bricks builder, there is no problem.

But once I use “Enable Media Replace” from Shortpixel on media page all nested slider on the page disappear on bricks builder and the page will show php error warning

The annoying thing is that, If I replace 1 photo only that is in the nested slider. All sliders in the page get affected and I have to replace them all.

Hope this enough!