Closed pd-cm closed 3 months ago
This is related to WP core itself in how it handles attributes, I’m not sure if there’s a safe way to strip those out without potentially messing with a query that was using the <br/>
tags intentionally.
I don't think line breaks were ever intended to be used in shortcode attributes themselves but it's for sure never been supported in Pods shortcodes in the past.
Description
In this Slack support request, a Pods shortcode WHERE query was failing because there was a return within the WHERE statement.
I do not know if this is an issue with Gutenberg, WordPress core, or something within Pods, but the general idea is that something is converting line breaks to HTML
<br/>
tags before shortcodes and shortcode attributes are parsed.The result is a silent failure due to SQL error unless Query Monitor is installed.
Version
3.0.8
Testing Instructions
See the video and pods.json in the Slack thread.
Or write a Pods shortcode which has a WHERE query with a return in it, which should be both valid SQL and a valid attribute, except that the return is converted to HTML before it gets to MySQL.
Screenshots / Screencast
https://github.com/pods-framework/pods/assets/38669929/10af9255-58bd-41b0-b786-5ce86ef06e01
Possible Workaround
Change some content-related filter priorities, or output meaningful SQL errors. A PHP try/catch statement can catch both
Error | Exception
-- e.g., either a fatal error or thrown exception, returning the message.Site Health Information
No response
Pods Package