From c63297bfba37b2010d3b57b1a87314be74ff3297 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Wed, 8 Mar 2017 15:39:56 -0500 Subject: [PATCH] Update for sql error error when searching for member events. --- index.php | 6 +++--- models/front/events/list.php | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/index.php b/index.php index a315082..8f1cdbe 100644 --- a/index.php +++ b/index.php @@ -3,7 +3,7 @@ * Plugin Name: GLM Members Database Events * Plugin URI: http://www.gaslightmedia.com/ * Description: Gaslight Media Members Database. - * Version: 1.6.22 + * Version: 1.6.23 * Author: Chuck Scott * Author URI: http://www.gaslightmedia.com/ * License: GPL2 @@ -20,7 +20,7 @@ * @package glmMembersDatabaseEventsAddOn * @author Chuck Scott * @license http://www.gaslightmedia.com Gaslightmedia - * @version 1.6.22 + * @version 1.6.23 */ /* @@ -38,7 +38,7 @@ * so that we're sure the other add-ons see an up to date * version from this plugin. */ -define('GLM_MEMBERS_EVENTS_PLUGIN_VERSION', '1.6.22'); +define('GLM_MEMBERS_EVENTS_PLUGIN_VERSION', '1.6.23'); define('GLM_MEMBERS_EVENTS_PLUGIN_DB_VERSION', '0.1.1'); // This is the minimum version of the GLM Members DB plugin require for this plugin. diff --git a/models/front/events/list.php b/models/front/events/list.php index 9d818ab..a3210b6 100644 --- a/models/front/events/list.php +++ b/models/front/events/list.php @@ -747,7 +747,8 @@ class GlmMembersFront_events_list extends GlmMembersFront_events_baseAction AND DATE(start_time) >= %s"; if ( $member_id = filter_var( $member_id, FILTER_VALIDATE_INT ) ) { - $sql .= " AND ref_dest = " . $member_id; + $sql .= " AND event in (SELECT id FROM " . GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . "events + WHERE ref_dest = " . $member_id . ")"; } return $this->wpdb->get_var( $this->wpdb->prepare( $sql, $from ) ); } -- 2.17.1