Open therealgilles opened 1 year ago
I tracked the bug down to this faulty regexp in redirect_posts_orderby
, which does not consider there could be blank spaces after ASC/DESC
:
// wp-content/plugins/the-events-calendar/src/Events/Custom_Tables/V1/WP_Query/Custom_Tables_Query.php
// Each `ORDER BY` entry could specify an order (DESC|ASC) or not.
// if ( preg_match( '~(?<orderby>.*?)\s?(?<order>ASC|DESC)$~i', $orderby_frag, $m ) ) {
if ( preg_match( '~(?<orderby>.*?)\s?(?<order>ASC|DESC)\s*$~i', $orderby_frag, $m ) ) {
$orderby = trim( $m['orderby'] );
$order = trim( $m['order'] );
} else {
// Follow the WordPress default and use DESC if no order is specified.
$orderby = $orderby_frag;
$order = 'DESC';
}
so it appears it's another TEC bug.
I've upgraded to Gatsby 5 and I'm now getting this WP database error (below) with QL-Events. As you can see, there is a duplicate 'DESC' in the 'ORDER BY' statement. I've tried the QL-Events 0.1.0 version but it breaks the GraphiQL IDE (quickly mentioning that the plugin version number is still at 0.0.1 in
ql-events.php
). I'm wondering if there is a known fix for this issue. I know TEC v6 has been full of bugs so that could ne another TEC bug. Any insight or help would be appreciated.