From e2e5213727325e28c1824cb831e9831bad870a50 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Wed, 30 Oct 2019 08:48:53 -0400 Subject: [PATCH] Fix query for versions. Don't return if dev or prod version is '-'. --- models/admin/ajax/pluginListSites.php | 45 ++++++++++++++++----------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/models/admin/ajax/pluginListSites.php b/models/admin/ajax/pluginListSites.php index 5b4072f..cc6f526 100644 --- a/models/admin/ajax/pluginListSites.php +++ b/models/admin/ajax/pluginListSites.php @@ -92,22 +92,22 @@ class GlmMembersAdmin_ajax_pluginListSites extends GlmDataSites if ( $server['production'] ) { $whereParts[] = "T.prod_server = " . $server['id']; $whereParts[] = "T.active"; - $whereParts[] = "T.id IN ( - SELECT site - FROM " . GLM_MEMBERS_PLUGINS_PLUGIN_DB_PREFIX . "site_plugins - WHERE prod_version != '' - AND prod_version IS NOT NULL - AND prod_version != '-' - )"; + // $whereParts[] = "T.id IN ( + // SELECT site + // FROM " . GLM_MEMBERS_PLUGINS_PLUGIN_DB_PREFIX . "site_plugins + // WHERE prod_version != '' + // AND prod_version IS NOT NULL + // AND prod_version != '-' + // )"; } else { $whereParts[] = "T.dev_server = " . $server['id']; - $whereParts[] = "T.id IN ( - SELECT site - FROM " . GLM_MEMBERS_PLUGINS_PLUGIN_DB_PREFIX . "site_plugins - WHERE dev_version != '' - AND dev_version IS NOT NULL - AND dev_version != '-' - )"; + // $whereParts[] = "T.id IN ( + // SELECT site + // FROM " . GLM_MEMBERS_PLUGINS_PLUGIN_DB_PREFIX . "site_plugins + // WHERE dev_version != '' + // AND dev_version IS NOT NULL + // AND dev_version != '-' + // )"; } } else { die( 'no server given' ); @@ -127,10 +127,19 @@ class GlmMembersAdmin_ajax_pluginListSites extends GlmDataSites ARRAY_A ); if ( $plugin ) { - $whereParts[] = "T.id IN ( - SELECT site - FROM " . GLM_MEMBERS_PLUGINS_PLUGIN_DB_PREFIX . "site_plugins - WHERE plugin = " . $plugin['id'] . ")"; + if ( $server['production'] ) { + $whereParts[] = "T.id IN ( + SELECT site + FROM " . GLM_MEMBERS_PLUGINS_PLUGIN_DB_PREFIX . "site_plugins + WHERE plugin = " . $plugin['id'] . " + AND prod_version != '-')"; + } else { + $whereParts[] = "T.id IN ( + SELECT site + FROM " . GLM_MEMBERS_PLUGINS_PLUGIN_DB_PREFIX . "site_plugins + WHERE plugin = " . $plugin['id'] . " + AND dev_version != '-')"; + } } } -- 2.17.1