Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-21129 - CLI API CSV import doesn't allow single-column CSVs #10924

Merged
merged 1 commit into from
Aug 31, 2017

Conversation

MegaphoneJon
Copy link
Contributor

Overview

When importing CSVs through the command line tool, you can't import a CSV with a single column.

Before

Run the following command:
php <civiroot>/bin/csv/import.php -e Setting --file /path/to/file/cli_allowed_countries.csv

"cli_allowed_countries" should have the following contents:

"countryLimit"                                                                                                                                                                                                     
"1039, 1076, 1085, 1109, 1228"

You'll receive an error:
Invalid file format for /path/to/file/cli_allowed_countries.csv. It must be a valid csv with separator ',' or ';'

After

After running the command in "Overview", you should have the following Allowed Countries in Administer » Localization » Languages, Currency, Location for "Allowed Countries": Canada, France, Greece, Japan, United States. The output of your import command should be:
line 2: created Setting id: 1

Comments

This is a very small change in a part of the codebase only touched by technical folks - a quick PR to review 😄

@eileenmcnaughton
Copy link
Contributor

I agree with you - this is rarely used & highly technical & if removing a die works based on your analysis then I'm happy to merge

@eileenmcnaughton eileenmcnaughton merged commit 13c55bc into civicrm:master Aug 31, 2017
@MegaphoneJon MegaphoneJon deleted the CRM-21129 branch October 10, 2017 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants