Plugin Directory

Changeset 2718757


Ignore:
Timestamp:
05/05/2022 07:47:13 PM (4 years ago)
Author:
claygriffiths
Message:

Update to version 3.1.27 from GitHub

Location:
gravity-forms-custom-post-types
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • gravity-forms-custom-post-types/tags/3.1.27/gfcptaddon.php

    r2665012 r2718757  
    44Plugin URI: https://gravitywiz.com/
    55Description: Map your Gravity-Forms-generated posts to a custom post type and/or custom taxonomies.
    6 Version: 3.1.26
     6Version: 3.1.27
    77Author: Gravity Wiz
    88Author URI: https://gravitywiz.com/
     
    1717    private static $name                     = 'Gravity Forms + Custom Post Types';
    1818    private static $slug                     = 'GFCPTAddon';
    19     private static $version                  = '3.1.26';
     19    private static $version                  = '3.1.27';
    2020    private static $min_gravityforms_version = '1.9.3';
    2121
  • gravity-forms-custom-post-types/tags/3.1.27/gfcptaddonbase.php

    r2588045 r2718757  
    442442            }
    443443
    444             if ( ! array_key_exists( "errors", $terms ) ) {
     444            if ( ! isset( $terms->errors ) ) {
    445445                foreach ( $terms as $term ) {
    446446                    $choices[] = array( 'value' => $term->term_id, 'text' => $term->name );
     
    593593        }
    594594
     595        /**
     596         * @param $value
     597         * @param \GF_Field $field
     598         * @param $entry
     599         * @param $form
     600         *
     601         * @return mixed|string
     602         */
    595603        function display_term_name_on_entry_detail( $value, $field, $entry, $form ) {
     604
     605            if ( $field->populateTaxonomy && in_array( $field->get_input_type(), array( 'checkbox', 'multiselect' ) ) ) {
     606                $values = GFFormsModel::get_lead_field_value( $entry, $field );
     607                if ( $field->get_input_type() === 'multiselect' ) {
     608                    $values = json_decode( $values );
     609                }
     610                foreach ( $values as &$_value ) {
     611                    $_value = $this->get_term_name( $_value, $field );
     612                }
     613                return $field->get_value_entry_detail( $values );
     614            }
     615
    596616            return $this->get_term_name( $value, $field );
    597617        }
    598618
    599         function display_term_name_on_entry_list( $value, $form_id, $field_id ) {
     619        function display_term_name_on_entry_list( $value, $form_id, $field_id, $entry = null ) {
    600620
    601621            if ( is_numeric( $field_id ) ) {
    602                 $field = GFFormsModel::get_field( GFAPI::get_form( $form_id ), $field_id );
    603                 $value = $this->get_term_name( $value, $field );
     622                $form  = GFAPI::get_form( $form_id );
     623                $value = $this->display_term_name_on_entry_detail( $value, GFAPI::get_field( $form, $field_id ), $entry, $form );
    604624            }
    605625
     
    607627        }
    608628
    609         function display_term_name_on_export( $value, $form_id, $field_id ) {
    610             return $this->display_term_name_on_entry_list( $value, $form_id, $field_id );
     629        function display_term_name_on_export( $value, $form_id, $field_id, $entry = null ) {
     630            return $this->display_term_name_on_entry_list( $value, $form_id, $field_id, $entry );
    611631        }
    612632
  • gravity-forms-custom-post-types/tags/3.1.27/readme.txt

    r2665012 r2718757  
    8181
    8282== Changelog ==
     83
     84= 3.1.27 =
     85* Fixed an issue where term names were not displayed for multi-value fields like Checkboxes and Multi-selects in the Entry List and Entry Detail views.
    8386
    8487= 3.1.26 =
  • gravity-forms-custom-post-types/trunk/gfcptaddon.php

    r2665012 r2718757  
    44Plugin URI: https://gravitywiz.com/
    55Description: Map your Gravity-Forms-generated posts to a custom post type and/or custom taxonomies.
    6 Version: 3.1.26
     6Version: 3.1.27
    77Author: Gravity Wiz
    88Author URI: https://gravitywiz.com/
     
    1717    private static $name                     = 'Gravity Forms + Custom Post Types';
    1818    private static $slug                     = 'GFCPTAddon';
    19     private static $version                  = '3.1.26';
     19    private static $version                  = '3.1.27';
    2020    private static $min_gravityforms_version = '1.9.3';
    2121
  • gravity-forms-custom-post-types/trunk/gfcptaddonbase.php

    r2588045 r2718757  
    442442            }
    443443
    444             if ( ! array_key_exists( "errors", $terms ) ) {
     444            if ( ! isset( $terms->errors ) ) {
    445445                foreach ( $terms as $term ) {
    446446                    $choices[] = array( 'value' => $term->term_id, 'text' => $term->name );
     
    593593        }
    594594
     595        /**
     596         * @param $value
     597         * @param \GF_Field $field
     598         * @param $entry
     599         * @param $form
     600         *
     601         * @return mixed|string
     602         */
    595603        function display_term_name_on_entry_detail( $value, $field, $entry, $form ) {
     604
     605            if ( $field->populateTaxonomy && in_array( $field->get_input_type(), array( 'checkbox', 'multiselect' ) ) ) {
     606                $values = GFFormsModel::get_lead_field_value( $entry, $field );
     607                if ( $field->get_input_type() === 'multiselect' ) {
     608                    $values = json_decode( $values );
     609                }
     610                foreach ( $values as &$_value ) {
     611                    $_value = $this->get_term_name( $_value, $field );
     612                }
     613                return $field->get_value_entry_detail( $values );
     614            }
     615
    596616            return $this->get_term_name( $value, $field );
    597617        }
    598618
    599         function display_term_name_on_entry_list( $value, $form_id, $field_id ) {
     619        function display_term_name_on_entry_list( $value, $form_id, $field_id, $entry = null ) {
    600620
    601621            if ( is_numeric( $field_id ) ) {
    602                 $field = GFFormsModel::get_field( GFAPI::get_form( $form_id ), $field_id );
    603                 $value = $this->get_term_name( $value, $field );
     622                $form  = GFAPI::get_form( $form_id );
     623                $value = $this->display_term_name_on_entry_detail( $value, GFAPI::get_field( $form, $field_id ), $entry, $form );
    604624            }
    605625
     
    607627        }
    608628
    609         function display_term_name_on_export( $value, $form_id, $field_id ) {
    610             return $this->display_term_name_on_entry_list( $value, $form_id, $field_id );
     629        function display_term_name_on_export( $value, $form_id, $field_id, $entry = null ) {
     630            return $this->display_term_name_on_entry_list( $value, $form_id, $field_id, $entry );
    611631        }
    612632
  • gravity-forms-custom-post-types/trunk/readme.txt

    r2665012 r2718757  
    8181
    8282== Changelog ==
     83
     84= 3.1.27 =
     85* Fixed an issue where term names were not displayed for multi-value fields like Checkboxes and Multi-selects in the Entry List and Entry Detail views.
    8386
    8487= 3.1.26 =
Note: See TracChangeset for help on using the changeset viewer.