Hello,
Since upgrading to Meta Box 5.7.3 and Meta Box AIO 1.21.2, several Views throw fatal errors. I have narrowed it down to Views rendering shortcodes. If the output of the shortcode contains single quotes, Meta Box throws an error. It worked fine prior to the upgrade. I need a quick fix because many pages on our site are broken now.
There are two issues:
1) Meta Box no longer understands single quotes.
For example, this line in my custom shortcode:
$return_html = $return_html . '<div><button onclick="window.open(\'' . $file_url . '\', \'_blank\')">text</button></div>';
throws this error if rendered in a Meta Box View:
"Fatal error: Uncaught eLightUp\Twig\Error\SyntaxError: Unexpected token "name" of value "https" ("end of statement block" expected)"
If I change the line to this, the error is gone and it renders fine, but of course, the onclick does not work because I need single quotes:
$return_html = $return_html . '<div><button onclick="window.open(\"' . $file_url . '\", \"_blank\")">text</button></div>';
2) Shortcodes are executed even when commented out.
Setting a string to a shortcode name and commenting it out still throws an error if there is a problem with that shortcode. The shortcode is executed even though it is commented out.
{# set shortcode_string = '[shortcode_name]' #}
This may not be related to problem 1, and perhaps it's not a new issue in this version, but it made debugging harder.
Thanks,
Arno