From 0bc2993697932249a4e3f157667a76a581f14078 Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Thu, 11 Aug 2016 11:34:03 -0400 Subject: [PATCH] Fixed problem when member contact added a package that the package slug was not updated. Also fixed errant display that a member contact is editing a "multi-member" package, which they can't do. --- index.php | 6 +++--- models/admin/packaging/index.php | 6 ++++++ setup/frontHooks.php | 7 +++++++ views/admin/packaging/index.html | 6 +++++- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/index.php b/index.php index d38fa42..5383c76 100644 --- a/index.php +++ b/index.php @@ -3,7 +3,7 @@ * Plugin Name: GLM Members Database Packaging * Plugin URI: http://www.gaslightmedia.com/ * Description: Gaslight Media Members Database. - * Version: 1.1.8 + * Version: 1.1.9 * Author: Gaslight Media * Author URI: http://www.gaslightmedia.com/ * License: GPL2 @@ -19,7 +19,7 @@ * @package glmMembersDatabasePackagingAddOn * @author Chuck Scott * @license http://www.gaslightmedia.com Gaslightmedia - * @version 1.1.8 + * @version 1.1.9 */ /* @@ -37,7 +37,7 @@ * so that we're sure the other add-ons see an up to date * version from this plugin. */ -define('GLM_MEMBERS_PACKAGING_PLUGIN_VERSION', '1.1.8'); +define('GLM_MEMBERS_PACKAGING_PLUGIN_VERSION', '1.1.9'); define('GLM_MEMBERS_PACKAGING_PLUGIN_DB_VERSION', '1.1.2'); // This is the minimum version of the GLM Members DB plugin require for this plugin. diff --git a/models/admin/packaging/index.php b/models/admin/packaging/index.php index 66ad6d0..0e1204a 100644 --- a/models/admin/packaging/index.php +++ b/models/admin/packaging/index.php @@ -152,6 +152,9 @@ class GlmMembersAdmin_packaging_index extends GlmDataPackages // If the package inserted successfully if ($packageInfo && $packageInfo['status']) { + // Update the package title slug + $this->updateSlug($packageInfo['fieldData']['id']); + // Get the new package ID $packageID = $packageInfo['fieldData']['id']; @@ -195,6 +198,9 @@ class GlmMembersAdmin_packaging_index extends GlmDataPackages // If it updated successfully if ($packageInfo && $packageInfo['status']) { + // Update the package title slug + $this->updateSlug($packageID); + // Get the package data again prepared for editing $packages = $this->editEntry($packageID); diff --git a/setup/frontHooks.php b/setup/frontHooks.php index da0292a..3aa3a09 100644 --- a/setup/frontHooks.php +++ b/setup/frontHooks.php @@ -78,10 +78,17 @@ if (strpos(GLM_MEMBERS_PLUGIN_CURRENT_URL, $this->config['settings']['canonical_ global $wpdb; $GLOBALS['glmPackageName'] = $wpdb->get_var( "SELECT title FROM ".GLM_MEMBERS_PACKAGING_PLUGIN_DB_PREFIX . "packages WHERE package_slug = '".$GLOBALS['glmDetailSlug']."'" ); +<<<<<<< Updated upstream // Set the page title to the event name - Using low priority so it's the last to set the title! add_filter('wp_title', function($title) { return $GLOBALS['glmPackageName']; }, 99, 1); +======= + // Set the page title to the event name + add_filter('wp_title', function() { + return $GLOBALS['glmPackageName']; + }); +>>>>>>> Stashed changes } // Add package slug query var diff --git a/views/admin/packaging/index.html b/views/admin/packaging/index.html index 7859834..8d48d49 100644 --- a/views/admin/packaging/index.html +++ b/views/admin/packaging/index.html @@ -9,7 +9,11 @@ {if $option == 'edit'} -

Edit Multi-{$terms.term_member_cap} Package

+ {if $lockedToMember} +

Edit Package

+ {else} +

Edit Multi-{$terms.term_member_cap} Package

+ {/if} Delete this Package
-- 2.17.1