This is a regression from Bricks 1.11 (where it still worked). When using the "bricks/frontend/render_data" filter, the Bricks editor breaks and a JS error appears:
Create a plugin or insert this code into your theme file:
<?php
/*
* Plugin Name: Bricks Filter Bug
*/
add_filter("bricks/frontend/render_data", function ($content, $post_context, $area) {
if ($area !== "content") { return $content; }
// $content .= '<div id="test1">test1</div><div id="test2">test2</div>'; // This works
$content .= '<div id="test1">test1</div>inbetween<div id="test2">test2</div>'; // This doesn't work
return $content;
}, 10, 3);
Open the Bricks editor.
Expected behavior:
Everything functions normally.
Actual behavior:
Elements that are on the right in the tree view aren’t displayed any more in the preview.
In the JS console, the above error appears.
Notes:
When you uncomment the first line with "$content .=" in the code and comment the second one, everything works again. It seems that having text between HTML tags breaks the editor! It’s the same behavior if you add HTML comments.
I noticed that opening the video in Firefox shows it only as 10s long for some reason. It works when I open it in Chrome. Could you try that please? Otherwise, maybe download it. If that doesn’t work, I’m also happy to re-upload it somewhere else.
I’m so sorry for not responding at that time! I had the message already partly written (I saw it in draft), and I guess I got distracted at that time and I forgot to answer.
Anyway, I was able to replicate the issue on 1.12.3, but not on the latest internal version. This might suggest that the issue was fixed.
I think it’s best that you wait for next Bricks release (2.0 alpha), and check then. If it’s fixed, the all good, and if it’s not, then I was not testing correctly and we will try to replicate it again at that time.