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

Fixed missing values on transposing. #177

Closed doekenorg closed 1 year ago

doekenorg commented 1 year ago

Requirements for this bug:

If a checkbox list had no selected values in the entry it would not yield any result, making the resulting entry row incomplete compared to the fields list. This is no problem for a normal export, but when transposing the array mismatch creates a broken array.

example:

$output = [
    //fields
    [
        0 => 'Some field',
        1 => 'checkbox list field',
        2 => 'third field',
    ],
    // results
    [
        0 => 'Some value',
        2 => 'third value',
    ]
];

// Broken:
$transposed = [
    [ 'Some field', 'some value' ],
    [ 'checkbox list field', 'third value' ],
    [ 'third field' ]
];