Skip to content

Commit

Permalink
Fix - Empty column if the likert data is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
MILAN88888 committed Sep 16, 2024
1 parent b31e02b commit f3069f0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions includes/export/class-evf-entry-csv-exporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,15 @@ protected function generate_row_data( $entry ) {
if ( array_key_exists( $column_id, $form_fields ) ) {
$form_field = $form_fields[ $column_id ];
$likert_columns = $form_field['likert_columns'];
foreach ( $fields[ $column_id ]['value_raw'] as $likert_key ) {
$selected_likert[] = $likert_columns[ $likert_key ];
$likert_rows = $form_field['likert_rows'];
if ( ! empty( $fields[ $column_id ]['value_raw'] ) ) {
foreach ( $fields[ $column_id ]['value_raw'] as $likert_key ) {
$selected_likert[] = $likert_columns[ $likert_key ];
}
} else {
foreach ( $likert_rows as $likert_rows ) {
$selected_likert[] = '';
}
}
}
$value = $selected_likert;
Expand Down

0 comments on commit f3069f0

Please sign in to comment.