Taxonomies Exported as XML not Importing - No Terms Imported
| Project: | Taxonomy import/export via XML |
| Version: | 6.x-1.2 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
I exported a vocabulary from my old Drupal 5 site via Taxonomy Import/Export via XML v5.x 1.0
I installed Taxonomy Import/Export via XML v6.x 1.2 on my new Drupal 6 site and I tried to import the taxonomy.
The vocabulary was created but no terms were imported.
I looked over the module and the problem seems to stem from the fact that xml_format.inc included in the 6.x release still uses the old Drupal 5 function taxonomy_get_vocabulary to get the vocabulary information rather than taxonomy_vocabulary_load.
This occurs on line 32
$vocabulary = module_invoke('taxonomy', 'get_vocabulary', $vid);and line 160
$_tx_vocabulary = (array) (module_invoke('taxonomy', 'get_vocabulary', $vid));They should be
$vocabulary = module_invoke('taxonomy', 'vocabulary_load', $vid);and
$_tx_vocabulary = (array) (module_invoke('taxonomy', 'vocabulary_load', $vid));respectively. Making those changes fixed the problem.
Patch file with the fixes included.
On another related note, there is some non-critical bugs related to xml_format.inc that I noticed that I will post to another ticket.
| Attachment | Size |
|---|---|
| patch.txt | 954 bytes |

#1
Forgot to flag the issue as having a patch. It works for me--but that's the extent of the testing.
#2
I've applied the patch to current stable release, and have also played with the latest DEV release - and at best I'm able to import about 15% of the vocab items.
Not quite sure where to go as occasionally a few errors are being reported during XML import/export:
- On one occasion the error was
warning: Invalid argument supplied for foreach() in ../sites/all/modules/taxonomy_xml/xml_format.inc on line 36.No idea what that's about yet- the other error received was
# Failed to parse file: Mismatched tag at line 4.# warning: Invalid argument supplied for foreach() in ..\sites\all\modules\taxonomy_xml\taxonomy_xml.module on line 378
TCS and RDF don't seem to be working for me either at the moment and everything is seeming a little inconsistent as some terms seem to get through the export/import cycle, while most don't. Kinda about to panic as I need to get some content live (including a few hundred taxonomy items), so may burn some midnight oil to investigate the closing XML tags. However, if anyone else finds a solution today, please post. I'll have a look at a patch to the patch before the week's end.
#3
That's logical.
xml_format.inc didn't get much testing after the port.
Looks like the change makes sense. I'll try to include it soon.
EDIT - OK, that's committed. Thanks.
#4
Regarding XML errors - well that's XML for you.
1. run it through a validator of any type (I use xmllint on the commandline, but many text editors can now help also)
2. if that's not the problem , upload a copy of it I guess.
I suspect wierdness in the output source myself - the legacy version export DOES NOT USE XML constructors, just strings together tag soup. So invalid html or entities in the source will crash later on.
#5
Awesome! I tried an XML export/import today [with 6.x-1.x-dev - 2009-Feb-05] and worked without a hitch. Both vocabs were of about a 100 terms with 2 tiers and looks great.
Didn't get to try TCS/RDF, so didn't want to change the status of this issue. Thanks for the changes
#6
This fix is in the DRUPAL-6--1-3 release. Thanks
#7
Automatically closed -- issue fixed for 2 weeks with no activity.