WIP: Editor shows elements twice if there is a Post-Content-Template and a SVG element

Browser: Chrome 110
OS: macOS
Video: https://demo.pschwind.de/bricksbug/bricks-svg-and-post-content-template-bug.mp4

Steps to reproduce:

  • Enable code execution
  • Edit or create a Bricks post
  • Add some elements, e.g. basic text elements
  • Add an SVG element
  • Set the SVG element to code and use this empty SVG: <svg xmlns="http://www.w3.org/2000/svg"></svg> (any other SVG should work as well)
  • Save the page and refresh it. The editor will load correctly.
  • Create a new template
  • Insert a “Post Content” element into the template
  • Set the template condition to “Entire website”
  • Save the template
  • Refresh the builder for the first Bricks post you created

Expected behavior:
The Bricks editor functions normally.

Actual behavior:
All elements are shown twice!

Additional notes:
When you remove the SVG and refresh the editor, the bug disappears and all the elements are only shown once (see video).

I reproduced the error on a clean WP + Bricks installation (see video).

1 Like

Hi Johannes,
Thanks so much for your report!

I reproduced the issue and added it to our bug tracker.
It happens only if the SVG is at the very top without any wrapper, so it’s relatively unlikely that it happens in real life.

Best regards,
timmse

This seems to be fixed in the latest stable release - thanks!

I have a very similar issue in 2.01 and 1.12.5

I can’t use code as a source for SVGs or I have entire sections displaying twice. My SVG code isn’t an empty tag and is located inside a section that isn’t first in structure panel.

Video: https://drive.google.com/file/d/1yX9Gy_L3J8KDzk5GHI3S7qm35oUBb-EV/view?usp=sharing

I have a global template that renders content via Content element:
image

JSON of it:

{"content":[{"id":"efzzpb","name":"post-content","parent":"omzruk","children":[],"settings":{"dataSource":"editor"}},{"id":"zrscos","name":"section","parent":0,"children":["omzruk"],"settings":{"_conditions":[[{"id":"tddxex","key":"dynamic_data","dynamic_data":"{acf_template_render_options}","compare":"==","value":"render_gutenberg"}],[{"id":"giprgk","key":"dynamic_data","dynamic_data":"{echo:has_blocks}","value":"1"},{"id":"dmliri","key":"dynamic_data","dynamic_data":"{acf_template_render_options}","compare":"!=","value":"render_bricks"}]]},"label":"Render Gutenberg "},{"id":"mhygkv","name":"post-content","parent":0,"children":[],"settings":{"dataSource":"bricks","_conditions":[[{"id":"rthttz","key":"dynamic_data","dynamic_data":"{acf_template_render_options}","compare":"==","value":"render_bricks"}],[{"id":"xeysez","key":"dynamic_data","dynamic_data":"{acf_template_render_options}","compare":"==","value":"render_blocks"}]]},"label":"Render Bricks Content"},{"id":"omzruk","name":"container","parent":"zrscos","children":["efzzpb"],"settings":{"taxonomies":["category","post_tag"],"_columnGap":"var(--space-m)","_rowGap":"var(--space-s)"}}],"source":"bricksCopiedElements","sourceUrl":"https://goodvibrationselectric91223.e.wpstage.net","version":"2.0.1","globalClasses":[],"globalElements":[]}

Hi raro,
At first glance, it looks like exactly the same problem. The task is still WIP (=work in progress), i.e. not yet fixed.

1 Like

Hi @timmse

Do you guys have any update on this glitch? Looks like it is still present.
Please let us know if you know when this could be looked into. Thanks v much

Hi @Daz, please show me a video where I can see your problem (and setup) clearly. In the best case scenario, you should reduce your example to the bare essentials.