Fatal single quote error in Meta Box 5.7.3 and AIO 1.21.2
- This topic has 7 replies, 5 voices, and was last updated 1 year, 9 months ago by
Jeremy Parrott.
-
AuthorPosts
-
June 24, 2023 at 3:12 PM #42346
Arno
ParticipantHello,
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,
ArnoJune 25, 2023 at 6:02 AM #42352A.
ParticipantHello.
I have a similar problem as the original poster described above.
The June 23 updates have broken my website. I did not receive any error messages, but all shortcodes used within my MB Views have stopped working.
I was not able to find an older version of Metabox AIO to rollback to for a temporary fix. So please address this as soon as possible.
Summary:
Views are not rendering shortcodes for some reason. Webpages using Views display everything but shortcodes (that they used to display before the update).June 25, 2023 at 10:33 AM #42355AJ Tatum
ParticipantYea, it seems like Meta Box really dropped the ball on testing this version thoroughly.
June 26, 2023 at 9:51 AM #42363Anh Tran
KeymasterHi Arno,
I'm trying to replicate the bug on my localhost but I don't see the error. I recorded a screencast, please take a look:
https://mega.nz/file/rvgFFAbL#DRCDlXxp4MIdjAx37dpL6T0v2W_DPXavAv42GeSGTns
June 26, 2023 at 12:30 PM #42366Arno
ParticipantHi Anh Tran,
Thanks for trying that. I have e-mailed more details and login credentials to my staging site. Please confirm if you have received that.
Kind regards,
ArnoJune 26, 2023 at 3:38 PM #42371Anh Tran
KeymasterHi Arno,
I got the details. Let me check that.
June 27, 2023 at 12:35 PM #42383Arno
ParticipantThis is solved in Meta Box AIO 1.21.3.
@Anh: thanks for your help. Please make sure that new Meta Box releases are tested on larger more complex websites. That will prevent a lot of trouble.
July 7, 2023 at 7:01 AM #42511Jeremy Parrott
ParticipantSame issue here. I had a critical error for all my template pages/views for my data. Looking for confirmation when we can safely update the plugin. I don't need anything now but I am posting to keep track of the responses.
-
AuthorPosts
- You must be logged in to reply to this topic.