From: Chuck Scott Date: Tue, 17 Apr 2018 14:04:57 +0000 (-0400) Subject: Fixed loop on emty arrays in customFieldsSupport.php X-Git-Tag: v1.0.0^2~8 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=a03e8adee3b408b5ec1e810c32f38987164ecca7;p=WP-Plugins%2Fglm-member-db-customfields.git Fixed loop on emty arrays in customFieldsSupport.php --- diff --git a/setup/commonHooks.php b/setup/commonHooks.php index 0003c1f..39798b2 100644 --- a/setup/commonHooks.php +++ b/setup/commonHooks.php @@ -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 ); - - + +