diff --git a/includes/Pods_GF.php b/includes/Pods_GF.php index cebe254..37276ad 100644 --- a/includes/Pods_GF.php +++ b/includes/Pods_GF.php @@ -1380,7 +1380,7 @@ public function _gf_to_pods_handler( $form, $entry = array() ) { $save_action = 'add'; - if ( empty( $id ) && ! empty( $entry['id'] ) && ( ! empty( $this->options['update_pod_item'] ) || apply_filters( 'pods_gf_to_pods_update_pod_items', false ) ) ) { + if ( empty( $id ) && ! empty( $entry['id'] ) && ( ! empty( $this->options['edit'] ) || ! empty( $this->options['update_pod_item'] ) || apply_filters( 'pods_gf_to_pods_update_pod_items', false ) ) ) { $item_id = (int) gform_get_meta( $entry['id'], '_pods_item_id' ); $item_pod = gform_get_meta( $entry['id'], '_pods_item_pod' ); @@ -3300,14 +3300,18 @@ public static function get_gf_field_value( $value, $params ) { $full_field = $gf_field->id; } - $cache_key = $form['id'] . ':' . $full_field; + $cache_key = false; - if ( ! empty( $field_options['id'] ) ) { - $cache_key .= ':' . $field_options['id']; - } + if ( ! empty( $entry ) ) { + $cache_key = $form['id'] . ':' . $entry['id'] . ':' . $full_field; + + if ( ! empty( $field_options['id'] ) ) { + $cache_key .= ':' . $field_options['id']; + } - if ( isset( $cached_field_value[ $cache_key ] ) ) { - return $cached_field_value[ $cache_key ]['value']; + if ( isset( $cached_field_value[ $cache_key ] ) ) { + return $cached_field_value[ $cache_key ]['value']; + } } if ( null === $value ) { @@ -3824,9 +3828,11 @@ public static function get_gf_field_value( $value, $params ) { $value = GFCommon::replace_variables( $value, $form, $entry ); } - $cached_field_value[ $cache_key ] = array( - 'value' => $value, - ); + if ( $cache_key ) { + $cached_field_value[ $cache_key ] = array( + 'value' => $value, + ); + } return $value; diff --git a/includes/Pods_GF_Addon.php b/includes/Pods_GF_Addon.php index 9a4822c..e4dcec4 100755 --- a/includes/Pods_GF_Addon.php +++ b/includes/Pods_GF_Addon.php @@ -908,6 +908,9 @@ public function process_feed( $feed, $entry, $form ) { } catch ( Exception $e ) { // @todo Log something to the form entry + if ( defined( 'WP_CLI' ) ) { + \WP_CLI::warning( 'Feed processing error: ' . $e->getMessage() ); + } } return null; diff --git a/includes/Pods_GF_CLI.php b/includes/Pods_GF_CLI.php index cbedbd2..edebc92 100644 --- a/includes/Pods_GF_CLI.php +++ b/includes/Pods_GF_CLI.php @@ -115,7 +115,7 @@ public function sync( $args, $assoc_args ) { $paging['offset'] = $entries_counter; - $entries = \GFAPI::get_entries( $form_id, $search_criteria, null, $paging, $total_entries ); + $entries = \GFAPI::get_entries( $form_id, $search_criteria, null, $paging ); } while ( $entries ); $progress_bar->finish(); diff --git a/pods-gravity-forms.php b/pods-gravity-forms.php index d05b045..815fc3f 100755 --- a/pods-gravity-forms.php +++ b/pods-gravity-forms.php @@ -3,7 +3,7 @@ Plugin Name: Pods Gravity Forms Add-On Plugin URI: https://pods.io/ Description: Integration with Gravity Forms (https://www.gravityforms.com/); Provides a UI for mapping a Form's submissions into a Pod -Version: 1.4 +Version: 1.4.1 Author: Pods Framework Team Author URI: https://pods.io/about/ Text Domain: pods-gravity-forms @@ -30,7 +30,7 @@ * @package Pods\Gravity Forms */ -define( 'PODS_GF_VERSION', '1.4' ); +define( 'PODS_GF_VERSION', '1.4.1' ); define( 'PODS_GF_FILE', __FILE__ ); define( 'PODS_GF_DIR', plugin_dir_path( PODS_GF_FILE ) ); define( 'PODS_GF_URL', plugin_dir_url( PODS_GF_FILE ) ); diff --git a/readme.txt b/readme.txt index ca6414d..5a4cceb 100755 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: https://pods.io/friends-of-pods/ Tags: pods, gravity forms, form mapping Requires at least: 4.6 Tested up to: 4.9.8 -Stable tag: 1.4 +Stable tag: 1.4.1 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -114,6 +114,10 @@ function my_column_row_override( $row, $columns, $form, $gf_field, $options, $re == Changelog == += 1.4.1 - October 16th, 2018 = + +* Fixed: When syncing multiple entries, the field values were caching and not unique per entry resulting in what appeared to be duplicated content inserts/updates. + = 1.4 - October 16th, 2018 = * Support: Added support for Gravity Forms 2.3 database tables changes (You may see a warning on the Edit Pod screen but this is a false positive because we cache a list of all tables to transients and it triggers the warning solved by removing those old "rg" tables)