Skip to content

Commit

Permalink
Merge branch 'develop' into 'master'
Browse files Browse the repository at this point in the history
release 1.10.2

See merge request luminfire/products/gravity-integrations/field-helper-for-gravity-forms!97
  • Loading branch information
andrewminion-luminfire committed Jan 15, 2024
2 parents 347f186 + 4801703 commit eb2f64c
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 64 deletions.
2 changes: 2 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ stages:
- release

variables:
PLUGIN_SLUG: field-helpe-for-gravity-forms
CLOUDFLARE_PAGES_PROJECT_NAME: field-helper-for-gravity-forms
# CLOUDFLARE_API_TOKEN: # add to GitLab CI/CD variable
PHP_VERSION: '7.4'

include:
- project: 'templates/gitlab/ci-templates'
Expand Down
18 changes: 10 additions & 8 deletions class-gf-field-helper-common.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,18 @@ public static function replace_field_names( $result ) {
$original_entry = $result;

foreach ( $result as $key => $value ) {
$sanitized_key = self::convert_field_id( $key );
$sanitized_key = self::convert_field_id( $key );
$field_and_form_id = self::convert_field_id( $key, $result['form_id'] );

if ( in_array( self::convert_field_id( $key, $result['form_id'] ), self::$checkbox_fields, true ) ) {
if ( array_key_exists( $field_and_form_id, self::$checkbox_fields ) ) {
// Checkbox.
if ( ! empty( $value ) ) {
$fields[ $labels[ absint( $sanitized_key ) ] ][] = $value;
}
} elseif ( array_key_exists( self::convert_field_id( $key, $result['form_id'] ), self::$nested_fields ) ) {
} elseif ( array_key_exists( $field_and_form_id, self::$nested_fields ) ) {
// Nested Form field.
if ( ! empty( $value ) ) {
switch ( self::$nested_fields[ self::convert_field_id( $key, $result['form_id'] ) ] ) {
switch ( self::$nested_fields[ $field_and_form_id ] ) {

case 'expanded':
if ( is_array( $value ) ) {
Expand Down Expand Up @@ -167,8 +168,8 @@ public static function replace_field_names( $result ) {
break;
}
}
} elseif ( array_key_exists( self::convert_field_id( $key, $result['form_id'] ), self::$signature_fields ) ) {
if ( self::$signature_fields[ self::convert_field_id( $key, $result['form_id'] ) ] === 'url' ) {
} elseif ( array_key_exists( $field_and_form_id, self::$signature_fields ) ) {
if ( self::$signature_fields[ $field_and_form_id ] === 'url' ) {
$field = GFAPI::get_field( $result['form_id'], absint( $sanitized_key ) );
$fields[ $labels[ $sanitized_key ] ] = $field->get_value_url( $value );
} else {
Expand Down Expand Up @@ -242,8 +243,9 @@ public static function get_form_friendly_labels( $form_id ) {

// Unset the choices.
foreach ( $field['inputs'] as $input_key => $input_id ) {
$input_id = self::convert_field_id( $input_id['id'], $form_id );
unset( $fields[ $input_id ] );
$input_and_form_id = self::convert_field_id( $input_id['id'], $form_id );
unset( $fields[ $input_and_form_id ] );
self::$checkbox_fields[ $input_and_form_id ] = $field['id'];
}

// Set array of checkbox fields.
Expand Down
106 changes: 53 additions & 53 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions documentation/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

# 1.10.2 | 2024-01-12

- Bugfix: fix combined checkbox field handling

# 1.10.1 | 2023-11-16

- Bugfix: fix automated release
Expand Down
4 changes: 2 additions & 2 deletions field-helper-for-gravity-forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Field Helper for Gravity Forms
* Plugin URI: https://brilliantplugins.com/
* Description: Enables Gravity Forms users to set consistent, human-friendly field names for use in the Gravity Forms REST API.
* Version: 1.10.1
* Version: 1.10.2
* Author: BrilliantPlugins
* Author URI: https://brilliantplugins.com
* License: GPL-2.0+
Expand All @@ -30,7 +30,7 @@
* @package brilliant-plugins/field-helper-for-gravity-forms
*/

define( 'GF_FIELD_HELPER_VERSION', '1.10.1' );
define( 'GF_FIELD_HELPER_VERSION', '1.10.2' );
define( 'GF_FIELD_HELPER_FILE', __FILE__ );
define( 'GF_FIELD_HELPER_SLUG', 'gravity-forms-field-helper' );

Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: luminfire, macbookandrew, brilliantplugins, nickciske, daverydan
Tags: forms, form entries, api, Gravity Forms, FileMaker, database, field names
Requires at least: 4.8
Tested up to: 6.2.2
Stable tag: 1.10.1
Stable tag: 1.10.2
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html

Expand Down

0 comments on commit eb2f64c

Please sign in to comment.