Fixed problem when member contact added a package that the package slug was not updated.
authorChuck Scott <cscott@gaslightmedia.com>
Thu, 11 Aug 2016 15:34:03 +0000 (11:34 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Thu, 11 Aug 2016 15:34:03 +0000 (11:34 -0400)
Also fixed errant display that a member contact is editing a "multi-member" package, which they can't do.

index.php
models/admin/packaging/index.php
setup/frontHooks.php
views/admin/packaging/index.html

index d38fa42..5383c76 100644 (file)
--- 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 <cscott@gaslightmedia.com>
  * @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.
index 66ad6d0..0e1204a 100644 (file)
@@ -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);
 
index da0292a..3aa3a09 100644 (file)
@@ -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
index 7859834..8d48d49 100644 (file)
@@ -9,7 +9,11 @@
 
         
       {if $option == 'edit'}
-        <h2>Edit Multi-{$terms.term_member_cap} Package</h2>
+        {if $lockedToMember}
+            <h2>Edit Package</h2>
+        {else}
+            <h2>Edit Multi-{$terms.term_member_cap} Package</h2>
+        {/if}
         <a id="deletePackageButton" class="button button-primary glm-button glm-right">Delete this Package</a>
         
         <div id="deletePackageDialog" class="glm-dialog-box" title="Delete Package">