GravityKit / GravityExport-Lite

GravityExport Lite. Export all Gravity Forms entries to Excel (.xlsx) via a secret (shareable) url.
https://gfexcel.com
GNU General Public License v2.0
12 stars 8 forks source link

Values containing arrays may be returned as string, causing errors (GP Media Library) #152

Closed doekenorg closed 10 months ago

doekenorg commented 1 year ago

A recent support issue showed problems with fields that return an array of values; which are supposed to be a string. This problem is very clear on the GravityPerks Media Library plugin; where the media Id's field returns an array.

This issue is two-fold:

As a feature we can also:

doekenorg commented 1 year ago

The temporary fix for the customer was:

add_filter( 'gfexcel_meta_value', function ( $value, $entry, $field ) {
    if ( strpos( $field->id, 'gpml_ids_' ) !== false && is_array( $value ) ) {
        $value = implode( ", ", $value );
    }

    return $value;
}, 10, 3 );
doekenorg commented 10 months ago

Released in 2.0.0