Description:
I am developing my first real project with Cwicly (so it can be some noob mistakes).
I am using Tailwind.
I am using Shuffle to generate the layout and I am using almost exclusively the “copy html to block” feature.
I am working locally with Local by Flywheel.
The error appeared multiple times:
First only on the front-end while deleting an element in the header (I succeeded recovering the error with some CTRL+Z) I thought it was because I used two tabs with the editor opened at the same time (one on the header the other on the page).
But then, it also crashed the editor while working on a “CTA” section… Maybe after a “paste” it happened really fast. Now I am not even able to recover the page I was working on.
Here the full error log:
Warning: simplexml_load_string(): Entity: line 1: parser error : Specification mandates value for attribute data-config- in /Users/laugau/Local Sites/naomi/app/public/wp-content/plugins/cwicly/core/includes/classes/class-helpers.php on line 1884
Warning: simplexml_load_string(): viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" data-config- in /Users/laugau/Local Sites/naomi/app/public/wp-content/plugins/cwicly/core/includes/classes/class-helpers.php on line 1884
Warning: simplexml_load_string(): ^ in /Users/laugau/Local Sites/naomi/app/public/wp-content/plugins/cwicly/core/includes/classes/class-helpers.php on line 1884
Fatal error: Uncaught Error: Call to a member function attributes() on bool in /Users/laugau/Local Sites/naomi/app/public/wp-content/plugins/cwicly/core/includes/classes/class-helpers.php:1885 Stack trace: #0 /Users/laugau/Local Sites/naomi/app/public/wp-content/plugins/cwicly/core/includes/dynamic/render.php(3293): Cwicly\Helpers::get_svg_attributes('<svg width="24"...') #1 /Users/laugau/Local Sites/naomi/app/public/wp-content/plugins/cwicly/core/includes/dynamic/render.php(431): cc_get_dyn('viewbox', Array, Array, Object(WP_Block), Array, NULL) #2 [internal function]: {closure}(Array) #3 /Users/laugau/Local Sites/naomi/app/public/wp-content/plugins/cwicly/core/includes/dynamic/render.php(436): preg_replace_callback('/(?!{}){(?!"|&q...', Object(Closure), '\n<svg class="cc...') #4 /Users/laugau/Local Sites/naomi/app/public/wp-content/plugins/cwicly/core/includes/dynamic/render.php(404): cc_parser('\n<svg class="cc...', Array, Object(WP_Block)) #5 /Users/laugau/Local Sites/naomi/app/public/wp-content/plugins/cwicly/core/includes/blocks/svg/svg.php(38): cc_render('\n<svg class="cc...', Array, Object(WP_Block)) #6 /Users/laugau/Local Sites/naomi/app/public/wp-includes/class-wp-block.php(258): cc_svg_render_callback(Array, '\n<svg class="cc...', Object(WP_Block)) #7 /Users/laugau/Local Sites/naomi/app/public/wp-includes/class-wp-block.php(244): WP_Block->render() #8 /Users/laugau/Local Sites/naomi/app/public/wp-includes/class-wp-block.php(244): WP_Block->render() #9 /Users/laugau/Local Sites/naomi/app/public/wp-includes/class-wp-block.php(244): WP_Block->render() #10 /Users/laugau/Local Sites/naomi/app/public/wp-includes/class-wp-block.php(244): WP_Block->render() #11 /Users/laugau/Local Sites/naomi/app/public/wp-includes/class-wp-block.php(244): WP_Block->render() #12 /Users/laugau/Local Sites/naomi/app/public/wp-includes/blocks.php(1484): WP_Block->render() #13 /Users/laugau/Local Sites/naomi/app/public/wp-includes/blocks.php(1522): render_block(Array) #14 /Users/laugau/Local Sites/naomi/app/public/wp-content/plugins/cwicly/core/includes/helpers/template-part.php(160): do_blocks('<!-- wp:cwicly/...') #15 /Users/laugau/Local Sites/naomi/app/public/wp-includes/class-wp-block.php(258): cc_modify_template_part_render(Array, '<!-- wp:cwicly/...', Object(WP_Block)) #16 /Users/laugau/Local Sites/naomi/app/public/wp-includes/blocks.php(1484): WP_Block->render() #17 /Users/laugau/Local Sites/naomi/app/public/wp-includes/blocks.php(1522): render_block(Array) #18 /Users/laugau/Local Sites/naomi/app/public/wp-includes/block-template.php(260): do_blocks('<!-- wp:templat...') #19 /Users/laugau/Local Sites/naomi/app/public/wp-includes/template-canvas.php(12): get_the_block_template_html() #20 /Users/laugau/Local Sites/naomi/app/public/wp-includes/template-loader.php(106): include('/Users/laugau/L...') #21 /Users/laugau/Local Sites/naomi/app/public/wp-blog-header.php(19): require_once('/Users/laugau/L...') #22 /Users/laugau/Local Sites/naomi/app/public/index.php(17): require('/Users/laugau/L...') #23 {main} thrown in /Users/laugau/Local Sites/naomi/app/public/wp-content/plugins/cwicly/core/includes/classes/class-helpers.php on line 1885
Step-by-step reproduction instructions: Please write the steps needed to reproduce the bug.
Use Shuffle and copy/paste some sections.
Make some edits.
I guess the error will finish to pop up.
Sadly, I didn’t succeed to isolate the error but I can provide a .zip export.
Thanks for the report.
Could you possibly send support@cwicly.com a few more details about the HTML you’re pasting into Cwicly?
It seems as if there might be some invalid characters within the SVGs that are being added.
Thanks for providing the local installation to us, this helped us debug the situation.
There were a few invalid SVGs in your design (data attributes with a - at the end and no value) which were not being fixed in our initial function.
Thanks for confirming this no longer causes a fatal error on your end, much appreciated!