I am attempting to use Drush to manage my vocabularies and I'm running into an error.
The command I'm using looks like this:
drush taxocsv-import /Volumes/Bullfrog/om/sites/all/taxonomies/age_group.csv tree --vocabulary_id=age_group --result_term
I want to import the file age_group csv and have it overwrite the taxonomy with the machine name "age_group", which already exists in my database.
But upon inputting this command, I get the following error after "Checking options...":
Unknown options: structure-tables, skip-tables, config-file, context-path, php.
Then I see "Reset language for all terms" appear twice.
In my database, a new vocabulary is created called "age_group 2" with a machine name of "age_group_212_43960".
There are no terms in the category.
I am attaching the file I used to make the import, which I created by making an export using the web interface.
I am running drush 5.0-rc4, but I also tried drush 4.5 and drush 4.4-- both of which also gave me the same error.
Any help you can offer would be much appreciated.
Comment | File | Size | Author |
---|---|---|---|
#10 | taxonomy_csv-rm_unknown_options_check-1475952-10.patch | 732 bytes | groovehunter |
age_group.csv_.zip | 225 bytes | ptmkenny |
Comments
Comment #1
Daniel_KM CreditAttribution: Daniel_KM commentedHi,
Thanks for your full infos on the bug. This is probably related to your Drush version.
For my part, I use Drush 4.5 and I've imported your file without problem, except for
result_term
(it should beresult_terms
).You can import your vocabulary with Drush 5.0 if you comment lines 173 to 182 of taxonomy_csv.drush.inc.
Sincerely,
Daniel Berthereau
Infodoc & Knowledge management
Comment #2
Daniel_KM CreditAttribution: Daniel_KM commentedHi,
Others remarks on your message:
--vocabulary_id
can't be used alone: you need to add the option--vocabulary_target=existing
.I've committed a patch to avoid to check options
"structure-tables, skip-tables, config-file, context-path, php"
in order to be compatible with Drush 5.0, currently unstable. The patch allows too to use--vocabulary_id
alone. This vocabulary will automatically be used even if--vocabulary_target=existing
is not set.Sincerely,
Daniel Berthereau
Infodoc & Knowledge management
Comment #3
ptmkenny CreditAttribution: ptmkenny commentedThank you! I downloaded and installed the latest dev version and ran the following command, which I modified as per your instructions:
drush taxocsv-import /Volumes/Bullfrog/om/sites/all/taxonomies/age_group.csv tree --vocabulary_id=age_group --vocabulary_target=existing --result_terms
However, I am now getting the following error with drush 5.0-rc4:
- Unknown options: php-options. [error]
I then tried drush 4.5, which worked fine (no error). (Before, I reported that I also had the error with drush 4.4 and 4.5. This was because I forgot to clear the drush cache using 'drush cache-clear drush' after checking out a new drush version with git.)
Comment #4
Daniel_KM CreditAttribution: Daniel_KM commentedHi,
Thanks for your comment. I fixed taxonomy_csv.drush.inc to avoid this new error with Drush 5. I hope that Drush 5 will be stable soon!
Sincerely,
Daniel Berthereau
Infodoc & Knowledge management
Comment #6
maxrossello CreditAttribution: maxrossello commentedHi,
reopening this since I am experiencing a similar problem with drush 5.7 (tried also 5.5 before).
drush @max vocimp /var/chroot/home/content/21/9347221/site/taxonomy/regions.csv tree --enclosure='"' --check_hierarchy --vocabulary_id=region --vocabulary_target=existing
The output is:
Any additional terms in the csv file are not imported.
It is anyway necessary to specify
--vocabulary_target=existing
otherwise I obtain the very same first behavior reported here (new empty vocabulary, and still the 'Unknown outputs' print)
csv file is a simple hierarchical one
thanks
Comment #7
Daniel_KM CreditAttribution: Daniel_KM commentedHi,
On my distribution, Drush is released with a few months delay, so I can use only Drush 5.4. With it and the last dev release of Taxonomy CSV, there is no problem to import your csv file.
As soon as Drush 5.7 will be available on my OS, I check it. Meanwhile, you can try the last dev release, that will be released soon.
Sincerely,
Daniel Berthereau
Infodoc & Knowledge management
Comment #8
truyenle CreditAttribution: truyenle commentedMy case is a little bit different
I try both drush5.8 and 4.6 and both I do have this error
The drush command 'taxocsv_import /Users/tle/Downloads/Temp/newaa.csv tree' could not be found
I am using the latest dev version (2012-Jun-15)
thanks
Comment #9
ptmkenny CreditAttribution: ptmkenny commented@truyenle If you have a different error, you should open a new issue. One issue = one problem
Comment #10
groovehunter CreditAttribution: groovehunter commentedStill get that with drush 5.9 and current master.
Outcommented lines around 180, patch attached
for me works now:
1. deleted all vocs from unsuccessful tests
drush php-eval '$taxes=taxonomy_vocabulary_get_names(); foreach($taxes as $tax) { taxonomy_vocabulary_delete($tax->vid); }'
2. create vocabulary manually, ie. "Abteilung"
3. import
with flat voc like:
Comment #11
groovehunter CreditAttribution: groovehunter commentedhm seems I was not taking care enough for the branch - in this issues 5.x-dev branch it is fixed