Fix the clone member info feature for amenities.
authorSteve Sutton <steve@gaslightmedia.com>
Wed, 12 Apr 2017 18:54:54 +0000 (14:54 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Wed, 12 Apr 2017 18:55:54 +0000 (14:55 -0400)
Need to clone the member info amenities.

classes/glmMemberInfoClone.php

index c09cd1a..e630e7b 100644 (file)
@@ -108,6 +108,18 @@ class GlmMemberInfoClone
 
             $this->wpdb->query($sql);
 
+            // Duplicate all amenity_ref table entries
+            $sql = "
+                INSERT INTO ".GLM_MEMBERS_PLUGIN_DB_PREFIX."amenity_ref
+                       (amenity, amenity_value,ref_dest,ref_type)
+                SELECT amenity, amenity_value, $newID, " . $this->config['ref_type_numb']['MemberInfo'] . "
+                  FROM ".GLM_MEMBERS_PLUGIN_DB_PREFIX."amenity_ref
+                 WHERE ref_dest = $id
+            ;";
+
+            $this->wpdb->query($sql);
+
+
             // Load image gallery class
             require_once GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataImages.php';
             $Images = new GlmDataImages($this->wpdb, $this->config);