From: Steve Sutton Date: Thu, 19 Jul 2018 19:10:08 +0000 (-0400) Subject: Fix for unsetting images on icalfeed import X-Git-Tag: v1.6.88^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=a65598453801eb3e4b4d29e51a190788a3cd6cb5;p=WP-Plugins%2Fglm-member-db-events.git Fix for unsetting images on icalfeed import if there's no ical feed image then keey last image. --- diff --git a/index.php b/index.php index 7c527f0..0179606 100644 --- a/index.php +++ b/index.php @@ -4,7 +4,7 @@ * Plugin URI: http://www.gaslightmedia.com/ * Description: Gaslight Media Members Database. - * Version: 1.6.87 + * Version: 1.6.88 * Author: Chuck Scott * Author URI: http://www.gaslightmedia.com/ @@ -22,7 +22,7 @@ * @author Chuck Scott * @license http://www.gaslightmedia.com Gaslightmedia - * @version 1.6.87 + * @version 1.6.88 */ @@ -47,7 +47,7 @@ if (!defined('ABSPATH')) { * 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.87'); +define('GLM_MEMBERS_EVENTS_PLUGIN_VERSION', '1.6.88'); define('GLM_MEMBERS_EVENTS_PLUGIN_DB_VERSION', '0.1.5'); // This is the minimum version of the GLM Members DB plugin require for this plugin. diff --git a/models/front/events/icalFeedImport.php b/models/front/events/icalFeedImport.php index d9b832a..7022835 100644 --- a/models/front/events/icalFeedImport.php +++ b/models/front/events/icalFeedImport.php @@ -206,6 +206,18 @@ class GlmMembersFront_events_icalFeedImport $image = $res['newFileName']; } } + } else { + // See if we already have this image. + if ( $event_id ) { + $image = $this->wpdb->get_var( + $this->wpdb->prepare( + "SELECT image + FROM " . GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . "events + WHERE id = %d", + $event_id + ) + ); + } } $event_data = array( 'status' => $this->config['status_numb']['Active'],