Skip to content

Commit 7e19d8a

Browse files
authored
Merge pull request #171 from pods-framework/release/1.5.1
Pods Gravity Forms 1.5.1
2 parents 902debf + 3e2de5e commit 7e19d8a

5 files changed

Lines changed: 36 additions & 26 deletions

File tree

includes/Pods_GF.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3211,7 +3211,7 @@ public static function gf_field_input_read_only( $input_html, $field, $value, $l
32113211
if ( isset( $field['pageNumber'] ) && 0 < (int) $field['pageNumber'] && $last_page !== (int) $field['pageNumber'] ) {
32123212
self::$actioned[$form_id][__FUNCTION__] = (int) $field['pageNumber'];
32133213

3214-
$page_header = '<h3 class="gf-page-title">' . $form['pagination']['pages'][( (int) $field['pageNumber'] - 1 )] . '</h3>';
3214+
$page_header = '<h3 class="gf-page-title">' . wp_kses_post( $form['pagination']['pages'][( (int) $field['pageNumber'] - 1 )] ) . '</h3>';
32153215
}
32163216

32173217
if ( 'html' == $field_type ) {
@@ -3697,7 +3697,7 @@ public static function get_gf_field_value( $value, $params ) {
36973697
$value = $value_check;
36983698
}
36993699
} elseif ( 'us_state' === $pick_object ) {
3700-
$value = $gf_field->get_us_state_code( $value );
3700+
$value_check = $gf_field->get_us_state_code( $value );
37013701

37023702
if ( $value_check ) {
37033703
$value = $value_check;
@@ -4281,7 +4281,7 @@ public function _gf_validation( $validation_result ) {
42814281
return $validation_result;
42824282
}
42834283

4284-
if ( empty( $this->options['gf_to_pods_priority'] ) || 'validation' == $this->options['gf_to_pods_priority'] ) {
4284+
if ( empty( $this->options['gf_to_pods_priority'] ) || 'validation' === $this->options['gf_to_pods_priority'] ) {
42854285
try {
42864286
$this->_gf_to_pods_handler( $form );
42874287
}
@@ -4574,7 +4574,7 @@ public function _gf_after_submission( $entry, $form ) {
45744574
}
45754575

45764576
// Alternative gf_to_pods handling
4577-
if ( ! empty( $this->options['gf_to_pods_priority'] ) && 'submission' == $this->options['gf_to_pods_priority'] ) {
4577+
if ( ! empty( $this->options['gf_to_pods_priority'] ) && 'submission' === $this->options['gf_to_pods_priority'] ) {
45784578
try {
45794579
$this->options['entry'] = $entry;
45804580

includes/Pods_GF_Addon.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,9 @@ public function process_feed( $feed, $entry, $form ) {
905905
// Ensure other custom Pods GF submission handling does not duplicate.
906906
remove_action( 'gform_after_submission_' . $form['id'], [ $pods_gf, '_gf_after_submission' ] );
907907

908-
$id = $pods_gf->_gf_to_pods_handler( $form, $entry );
908+
$pods_gf->_gf_after_submission( $entry, $form );
909+
910+
$id = $pods_gf->options['pod_item_id'];
909911

910912
// Set post_id if we have it.
911913
if ( 'post_type' === $pods_gf->pod->pod_data['type'] ) {
@@ -1197,9 +1199,9 @@ public function setup_pods_gf( $form, $feed ) {
11971199
$options = array(
11981200
// array ( 'gf_field_id' => 'pod_field_name' )
11991201
'fields' => $fields,
1200-
'update_pod_item' => (int) pods_v( 'update_pod_item', $feed['meta'], 0 ),
1201-
'markdown' => (int) pods_v( 'enable_markdown', $feed['meta'], 0 ),
1202-
'auto_delete' => (int) pods_v( 'delete_entry', $feed['meta'], 0 ),
1202+
'update_pod_item' => 1 === (int) pods_v( 'update_pod_item', $feed['meta'], 0 ),
1203+
'markdown' => 1 === (int) pods_v( 'enable_markdown', $feed['meta'], 0 ),
1204+
'auto_delete' => 1 === (int) pods_v( 'delete_entry', $feed['meta'], 0 ),
12031205
'gf_to_pods_priority' => 'submission',
12041206
);
12051207

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pods-gravity-forms",
3-
"version": "1.5.0",
3+
"version": "1.5.1",
44
"description": "PIntegration with Gravity Forms; Provides a UI for mapping a Form's submissions into a Pod.",
55
"author": "Pods Foundation, Inc",
66
"homepage": "https://pods.io/",

pods-gravity-forms.php

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
Plugin URI: https://pods.io/
55
Requires Plugins: pods
66
Description: Integration with Gravity Forms (https://www.gravityforms.com/); Provides a UI for mapping a Form's submissions into a Pod
7-
Version: 1.5.0
7+
Version: 1.5.1
88
Author: Pods Framework Team
99
Author URI: https://pods.io/about/
1010
Text Domain: pods-gravity-forms
1111
GitHub Plugin URI: https://github.com/pods-framework/pods-gravity-forms
1212
13-
Copyright 2013-2024 Pods Foundation, Inc (email : contact@podsfoundation.org)
13+
Copyright 2013-2025 Pods Foundation, Inc (email : contact@podsfoundation.org)
1414
1515
This program is free software; you can redistribute it and/or modify
1616
it under the terms of the GNU General Public License as published by
@@ -31,7 +31,7 @@
3131
* @package Pods\Gravity Forms
3232
*/
3333

34-
define( 'PODS_GF_VERSION', '1.5.0' );
34+
define( 'PODS_GF_VERSION', '1.5.1' );
3535
define( 'PODS_GF_FILE', __FILE__ );
3636
define( 'PODS_GF_DIR', plugin_dir_path( PODS_GF_FILE ) );
3737
define( 'PODS_GF_URL', plugin_dir_url( PODS_GF_FILE ) );
@@ -80,7 +80,7 @@ function pods_gf_include_gf_addon() {
8080
*/
8181
function pods_gf_init() {
8282

83-
if ( ! function_exists( 'pods' ) || ! class_exists( 'GFCommon' ) ) {
83+
if ( ! function_exists( 'pods' ) || ! class_exists( 'GFCommon' ) || has_action( 'wp', 'pods_gf_ui_init' ) ) {
8484
return false;
8585
}
8686

@@ -98,6 +98,8 @@ function pods_gf_init() {
9898
add_action( 'wp_ajax_nopriv_pods_gf_save_for_later', 'pods_gf_save_for_later_ajax' );
9999
}
100100

101+
return true;
102+
101103
}
102104

103105
add_action( 'init', 'pods_gf_init' );
@@ -126,12 +128,12 @@ function pods_gf_admin_nag() {
126128
*/
127129
function pods_gf_add_related_objects() {
128130

129-
PodsField_Pick::$related_objects['gf-forms'] = array(
131+
PodsField_Pick::$related_objects['gf-forms'] = [
130132
'label' => __( 'Forms', 'pods' ),
131133
'group' => __( 'Gravity Forms', 'pods' ),
132134
'simple' => true,
133135
'data_callback' => 'pods_gf_add_related_objects_forms',
134-
);
136+
];
135137

136138
}
137139

@@ -152,7 +154,7 @@ function pods_gf_add_related_objects() {
152154
*/
153155
function pods_gf_add_related_objects_forms( $name = null, $value = null, $options = null, $pod = null, $id = null ) {
154156

155-
$data = array();
157+
$data = [];
156158

157159
// Get all forms.
158160
$forms = RGFormsModel::get_forms( null, 'title' );
@@ -176,35 +178,36 @@ function pods_gf_add_related_objects_forms( $name = null, $value = null, $option
176178
*/
177179
function pods_gravity_forms_freemius() {
178180
try {
179-
fs_dynamic_init( array(
181+
fs_dynamic_init( [
180182
'id' => '5754',
181183
'slug' => 'pods-gravity-forms',
182184
'type' => 'plugin',
183185
'public_key' => 'pk_1aaaee6bf8963f2077405e84f2ac5',
184186
'is_premium' => false,
185187
'has_paid_plans' => false,
186188
'is_org_compliant' => true,
187-
'parent' => array(
189+
'parent' => [
188190
'id' => '5347',
189191
'slug' => 'pods',
190192
'public_key' => 'pk_737105490825babae220297e18920',
191193
'name' => 'Pods',
192-
),
193-
'menu' => array(
194+
],
195+
'menu' => [
194196
'slug' => 'pods-settings',
195197
'contact' => false,
196198
'support' => false,
197199
'affiliation' => false,
198200
'account' => true,
199201
'pricing' => false,
200202
'addons' => true,
201-
'parent' => array(
203+
'parent' => [
202204
'slug' => 'pods',
203-
),
204-
),
205-
) );
205+
],
206+
],
207+
] );
206208
} catch ( \Exception $exception ) {
207209
return;
208210
}
209211
}
212+
210213
add_action( 'pods_freemius_init', 'pods_gravity_forms_freemius' );

readme.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ Contributors: sc0ttkclark, jimtrue, naomicbush, gravityplus
33
Donate link: https://friends.pods.io/
44
Tags: pods, gravity forms, form mapping
55
Requires at least: 6.0
6-
Tested up to: 6.5
6+
Tested up to: 6.8
77
Requires PHP: 7.2
8-
Stable tag: 1.5.0
8+
Stable tag: 1.5.1
99
License: GPLv2 or later
1010
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1111

@@ -113,6 +113,11 @@ function my_column_row_override( $row, $columns, $form, $gf_field, $options, $re
113113

114114
== Changelog ==
115115

116+
= 1.5.1 - March 29th, 2024 =
117+
118+
* Fixed: Resolved issue with auto-delete option when using Pods feeds. (@sc0ttkclark)
119+
* Tested against WP 6.8. (@sc0ttkclark)
120+
116121
= 1.5.0 - March 29th, 2024 =
117122

118123
* New requirements that match Pods: WP 6.0+, PHP 7.2+, and Pods 3.0+ to prep for Pods Gravity Forms 2.0 (@sc0ttkclark)

0 commit comments

Comments
 (0)