Fixed loop on emty arrays in customFieldsSupport.php
authorChuck Scott <cscott@gaslightmedia.com>
Tue, 17 Apr 2018 14:04:57 +0000 (10:04 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Tue, 17 Apr 2018 14:04:57 +0000 (10:04 -0400)
setup/commonHooks.php

index 0003c1f..39798b2 100644 (file)
@@ -123,7 +123,7 @@ add_filter( 'glm-members-customfields-have-fields', function( $haveFields, $fid)
 add_filter( 'glm-members-customfields-form-display', function( $content, $fid, $recordId = 0, $parentFormId = false, $formData = false ){
 
     if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG) {
-        trigger_error('Custom Fields Filter Called: glm-members-customfields-form-display', E_USER_NOTICE);
+        trigger_error('Custom Fields Filter Called: glm-members-customfields-form-display For Form ID = '.$fid, E_USER_NOTICE);
     }
 
     // Call form display shortcode to do this work
@@ -161,8 +161,8 @@ add_filter( 'glm-members-customfields-form-submit', function( $content, $fid, $r
 
 /**
  * Store data from a call to the "glm-members-customfields-form-submit" filter
- * 
- * NOTE: The glm-members-customfields-form-submit filter above can store data for a form submission in one 
+ *
+ * NOTE: The glm-members-customfields-form-submit filter above can store data for a form submission in one
  * call. This filter is for situations where there may need to be additional processing between form submission
  * and storage.
  *
@@ -194,27 +194,27 @@ add_filter( 'glm-members-customfields-form-store', function( $content, $fid, $re
  * @param $content          string  Any supplied content. Form will be appended to this
  * @param $fid              string  Unique ID of form
  * @param $recordId         integer ID for instance of this form (generally the ID of the associated record) - Required
- * @param $priorityDisplay  boolean Display only priority fields flag 
+ * @param $priorityDisplay  boolean Display only priority fields flag
  *      Note that fields with a cost value are always considered to be priority.
  *
  * returns an array with HTML for displaying the results and an array of data that may be used for custom
  * display.
  */
 add_filter( 'glm-members-customfields-form-data-recall', function( $content, $fid, $recordId = 0, $priorityDisplay = false ){
-    
+
     if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG) {
         trigger_error('Custom Fields Filter Called: glm-members-customfields-form-data-recall', E_USER_NOTICE);
     }
-    
+
     require_once GLM_MEMBERS_CUSTOMFIELDS_PLUGIN_CLASS_PATH.'/data/dataCustomFields.php';
     $CustomFields = new GlmDataFieldsCustomFields($this->wpdb, $this->config);
-    
+
     $content = $CustomFields->getFormWithData($fid, $recordId, $priorityDisplay);
-    
+
     return $content;
-    
+
 }, 10, 4 );
-    
-        
+
+