Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-9251

bin/csv/export Address skips column during export if street address is blank

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Won't Fix
    • Affects Version/s: 3.4.7
    • Fix Version/s: Unscheduled
    • Component/s: CiviCRM API
    • Labels:
      None
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Needs Funding

      Description

      running export.php like so

      php bin/csv/export.php -uUSER -pPASS -sSITEKEY Address contact_id=1837

      creates CSV output for multiple addresses for a given individual that looks like this:

      id,contact_id,location_type_id,is_primary,is_billing,street_address,street_number,street_number_suffix,street_number_predirectional,street_name,street_type,street_number_postdirectional,street_unit,supplemental_address_1,supplemental_address_2,supplemental_address_3,city,county_id,state_province_id,postal_code_suffix,postal_code,usps_adc,country_id,geo_code_1,geo_code_2,timezone,master_id,name
      1685,1837,1,1,0,"1234 N. Sesame Street",Tucson,1002,85719,1228,32.4250389,-110.19502
      5299,1837,3,0,0,Tucson,1002,1228,32.2217429,-110.926479

      notice how the second address is missing a street address leading to skipped column (street_address), instead the correct CSV format should look like this:

      1685,1837,1,1,0,"1234 N. Sesame Street",Tucson,1002,85719,1228,32.4250389,-110.19502
      5299,1837,3,0,0,,Tucson,1002,1228,32.2217429,-110.926479

      Also, the column headings are incorrect and don't match the output of the data (this is in fact true for most Entities against which bin/csv/export.php is run)

      While the column headings can be inferred from the import behavior, the mis-formatting due to skipped columns is very hard to fix and leads to further data problems down the road.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              emphanos Young-Jin Kim
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 2 hours
                2h
                Remaining:
                Remaining Estimate - 2 hours
                2h
                Logged:
                Time Spent - Not Specified
                Not Specified