Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dman’s picture

The current CVS HEAD is D7
There's a huge amount of goodness in D7 taxonomy (fields and RDF for taxonomy) that it's taking advantage of.
It's actually working for me on D7 on all the test cases, but I haven't got a live D7 project or the ability to support too many branches at once. But it's there.

verres’s picture

any more headway on a full D7 port? looking to use this on a live site. thnx!

NancyDru’s picture

Dan, I would say that few people could fault you for freezing 5.x right where it is - that's one branch to not maintain.

akanouras’s picture

Issue tags: +#D7
FileSize
528 bytes

Thought I'd let you know I managed to use taxonomy_xml's Git master (as of commit 07453723187a1adc3594e64126423a02fc626dc5) on Drupal 7 to import 2 simple taxonomies exported by the latest taxonomy_xml-4.7.x-1.x-dev (on an very old Drupal 4.7 installation).

In both cases, 2 vocabularies were created, one I expected (with machine_name = '_', probably because the original vocabulary's name only had Greek characters in it, like 'Θέματα'), and another one with the first one's vid+1, with name = ' ', machine_name = ' ', description = NULL, hierarchy = 0, module = 'taxonomy', weight = 0.

After the import, there was a warning about a function getting a value instead of a reference, which didn't seem to affect the import process. I'm attaching a patch for that.

There was another message, 'Notice: Undefined variable: vocabulary στην taxonomy_xml_setup_vocabulary_from_data() (γραμμή 371 του /srv/www/mysite/sites/all/modules/taxonomy_xml/formats/xml_format.inc).', which may be related to the additional empty vocabulary being created. Again, the import process was successful despite this.

Thank you for your work,
Antonio

NancyDru’s picture

Title: Drupal 7 port » Taxonomy XML for D7
Status: Active » Needs review

Made title specific, set "needs review"

upupax’s picture

Tested the D7 port:
- I got an error trying to upload an xml file saying .xml was not an allowed extension;
- importing a big vocabulary export, the script exceeded 30 seconds and I got WSOD.

podarok’s picture

subscribe

podarok’s picture

Category: support » feature
Issue tags: +D7 porting
metaface’s picture

subscribe

metaface’s picture

marcusx’s picture

subscribe

djbobbydrake’s picture

subscribing

perhenrik’s picture

subscribing

chaosmind’s picture

subscribe

mattbk’s picture

subscribe

alpp’s picture

subscribe

znerol’s picture

Three patches in order to get taxonomy xml export working on Drupal 7.

  • Fix load path for moved format include files: Includes for several file formats were moved to the formats subdirectory. Fix this in taxonomy_xml.export.inc in order that the correct include file is loaded when exporting vocabularies and terms.
  • Use strlen instead of drupal_strlen for Content-Length header: The wrapper function drupal_strlen returns the number of characters in a multibyte string. However when setting the Content-Length HTTP header the plain strlen function should be used because there we want to know the number of bytes of the string. Otherwise the output is truncated by the browser if term titles contain multibyte characters.
  • Remove debug functions and make vocabulary export work
dman’s picture

Thanks.
Sorry subscribers, the company I'm contracted to kept me busy this year on the end of some huge D6 projects. This month I am finally able to get into more D7 jobs, and now have time & purpose to pull my neglected D7 module ports forward!
I'll see what I can do about rolling in this contribution and reviewing the status for a D7 release...

tinefin’s picture

subscribing

dman’s picture

I've got a project I want this for, so some attention will happen to it soon ... ish :-/

groovehunter’s picture

xml import works for me with current git master and arc2, exept for the notice

Warning: Parameter 1 to taxonomy_xml_taxonomy_term_load() expected to be a reference, value given in DrupalDefaultEntityController->attachLoad() (Zeile 334 von /var/www/vhosts/drupal-7.8/includes/entity.inc).

dman’s picture

Sorry everyone - I really should have tagged the master branch as a D7 - dev so we could get at it easier.
I've started that now
http://drupal.org/node/1303160

Also - the roadmap is to look at D7 Feeds and see if I can port an amount of this work over to merge with them - as add-on parsers and processors. That will be a rewrites of sorts, but in the meantime, this method still "supported" for now.

I'll hit those patches above from znerol now!

dman’s picture

Contributions from #17 @znerol rolled in, thanks - they were really good!

Also added rdf.module as a requirement as It is needed but wasn't listed.

progress!

Simon Naude’s picture

I'm getting the same error as http://drupal.org/node/841232#comment-4367216 (only the second vocabulary doesn't import any terms). My export was from a D5 site.

drzraf’s picture

Misc potential one-liners (didn't wanted to fills multiple separate bugs for these):

    add $GLOBALS['devel_shutdown'] = FALSE; at the end of taxonomy_xml_export_vocabulary.
    Not everyone use the devel module but I noticed that even after </taxonomy> the "devel" footer breaks the import.
    Setting-up this global here unconditionally does not hurt.
    add a "\n" to $output .= "</term>"; in xml_format.inc, it cost 1 byte but helps a lot developers (especially for text-editors and diff)
    add a taxonomy_vocabulary_machine_name_load check in taxonomy_xml_setup_vocabulary_from_data to avoid "SQL duplicate key"
    (I had hard time attempting figure out how the later function works; can't send a proper patch)
drzraf’s picture

Status: Needs work » Needs review

The 3 various hardcoded 'und' should also be replaced by LANGUAGE_NONE.
In taxonomy_xml.process.inc, taxonomy_xml_create_guid_field() :

    translatable and locked are integer according to the API.
    entity_type is not "required" in D7 but I would rather remove the comment and keep the the attribute
    unless there's a a long-term use/support for it. (but I don't really know the background of the module).
    taxonomy_xml_absorb_vocabularies is probably taxonomy_xml_absorb_vocabulary_definitions
podarok’s picture

Status: Needs review » Needs work
NicolasH’s picture

Status: Needs review » Needs work

Would it make sense to release a dev branch? Seems to work for the basics and would get more eyeballs for testing. Just used this for migrating a number of vocabularies from D6 to D7 and this was the only module that was up for the job.

dman’s picture

Sorry there.
A -dev branch has been on git for a long time now (October 2011 !!!), and has been working OK for me several times, though I think there were a few things that needed better testing. Can't remember what they were now.
I made the branch long ago, but somewhere between the dev branch happening on git and the d.o project release becoming available for me to 'publish' ... I got distracted into further debugging.

http://drupal.org/node/1303160
So, um, help needed.
A large amount of clutter has actually been DROPPED from the d7 branch as we have RDF and field-able terms in core now (I enjoyed getting that in) and something that is almost but not quite GUIDs for vocabs and terms.

I am not very interested in propping up the old XML-only syntax, as the RDF/SKOS syntax has emerged as a preferred leader in this field. Please export and import using that syntax where you can.
However, I know that a certain amount of demand for this module will be to take D6 taxa and get them into D7. That is supposed to work, but testing (with actual source data samples!!) and help will be needed.

dman’s picture

Version: master » 7.x-1.x-dev

tag shows up now, finally.

drzraf’s picture

but parts of the comment #26 are valid :)

Ozzie’s picture

subscribing

GStegemann’s picture

I found some issues today while clicking on the export tab:

'Page not found' error when attempting to open INSTALL.txt:

The requested page "/cm7/en/sites/all/modules/taxonomy_xml/INSTALL.txt" could not be found.

The above message may appear several time when switching from the export to import tab. In my case 5 times.

Warning: htmlspecialchars() expects parameter 1 to be string, array given in htmlspecialchars() (line 1559 of /var/www/html/cm7/includes/bootstrap.inc). =>

    ... (Array, 7 elements)
         6: htmlspecialchars() (Array, 1 element)
            args (Array, 3 elements)
                0 (Array, 5 elements)
                1 (Integer) 3
                2 (String, 5 characters ) UTF-8
         5: check_plain() (Array, 2 elements)
         4: taxonomy_xml_xml_create() (Array, 2 elements)
         3: taxonomy_xml_export_vocabulary() (Array, 2 elements)
         2: call_user_func_array() (Array, 1 element)
         1: menu_execute_active_handler() (Array, 2 elements)
         0: main() (Array, 2 elements) 

I hope this is of help.