Problem/Motivation

The '_webform_csv_headers_addressfield' function returns an empty header array instead of an array with an empty string. See $header[1] below:

  }
  else {
    $header[0] = array('');
    $header[1] = array();
    $header[2] = array($component['name']);
  }
  return $header;
}

When exporting CSV, $header[1] will not print an empty cell for the addressfield component, which will cause everything to the right of $header[1] to shift one column to the left.

Current behavior:

Preferred contact method
Name Address Phone Email Email address
Jane Smith 123 Garfield StSpringfield, IL 12345 x jsmith@example.com
Joe Smith 456 Ash StSpringfield, IL 12345 x jsmith1@example.com


Correct behavior:

Preferred contact method
Name Address Phone Email Email address
Jane Smith 123 Garfield StSpringfield, IL 12345 x jsmith@example.com
Joe Smith 456 Ash StSpringfield, IL 12345 x jsmith1@example.com

Proposed resolution

set $header[1] = array('')

Remaining tasks

Post patch

User interface changes

None

API changes

None

Data model changes

None

Comments

Chris Burge created an issue. See original summary.

chris burge’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new460 bytes

  • lambic committed 64b5db1 on 7.x-1.x authored by Chris Burge
    Issue #2959981 by Chris Burge: '_webform_csv_headers_addressfield'...
lambic’s picture

committed to 1.x, thanks!

lambic’s picture

Status: Needs review » Reviewed & tested by the community
chris burge’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.