Taxonomies Exported as XML not Importing - No Terms Imported

jfxberns - January 28, 2009 - 08:41
Project:Taxonomy import/export via XML
Version:6.x-1.2
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

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.

AttachmentSize
patch.txt954 bytes

#1

jfxberns - January 28, 2009 - 08:46
Status:active» needs review

Forgot to flag the issue as having a patch. It works for me--but that's the extent of the testing.

#2

snorkers - February 4, 2009 - 20:02

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
, which looks to be down to not providing the slash in the closing tid, vid, name, description, weight and depth tags in the XML that was produced during the export.

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

dman - February 5, 2009 - 01:44

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

dman - February 5, 2009 - 01:47

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

snorkers - February 13, 2009 - 00:01

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

dman - March 3, 2009 - 22:13
Status:needs review» fixed

This fix is in the DRUPAL-6--1-3 release. Thanks

#7

System Message - March 17, 2009 - 22:20
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.