29.0.7: template design options in BeBuilder (popup Height) are not saved
Hi,
Since 29.0.7 a design option on a template is not saved when I change it in BeBuilder. It works in 29.0.5.
I tested on a clean local install with no plugins: WordPress 6.9.12, PHP 8.3, Betheme 29.0.7.
(1) Open a Popup template in BeBuilder.
(2) Click the gear icon, and under Popup options > Design type 400px in Height.
(3) Click Update and reload the builder.
Height is empty again after the reload, and nothing is stored for it. A setting in the same panel that is not a design field does save: I set Position to Top Left in the same visit and it was kept.
I then put 29.0.5 on the same install and did the same thing with a new popup template. Height was still 400px after the reload.
On 29.0.7, with WP_DEBUG on, the PHP log got this warning when I changed the field:
wp_strip_all_tags expects parameter #1 ($text) to be a string, array given
So I looked at mfnvb_savepostoption() in visual-builder/visual-builder.php. In 29.0.7, line 1656 runs wp_strip_all_tags($value) on every value. For this field the builder sends an array (selector, style, val), so it comes back as an empty string and line 1665 has nothing left to save. 29.0.5 does not have that line. From the code it also looks like the empty value then goes to delete_post_meta, so changing a field could remove a value that was saved before the update. I have not tested that part.
I only tested the popup Height field. From the code I would expect the other popup and side menu design fields that are saved the same way to be affected too, but I have not tried them.
Could you take a look?
Thank you.
While waiting for a response from one of our team members, we recommend to check Support Center where it is highly likely that you will find the answer to your question in no time.
FAQ | Video Tutorials | How to