By byelle on
I'm working on a configuration script to automatically enable the taxonomy_xml module and import an xml file to populate the taxonomy. I'm trying to use the drupal_execute() function as follows:
$form_id = 'taxonomy_xml_import_form';
$field_values = array(
'vid' => '0',
'xml' => '/var/www/html/files/taxonomy_genre.xml',
'duplicate' => 0,
);
drupal_execute($form_id, $field_values);
However, it does not seem to work...nor does it produce an error. Note that xml is a form element of type file which the 'taxonomy_xml_import_form' normally uploads and parses. I suspect the issue is around this item. Has anyone run into this...?
Thank you for any ideas.
Comments
I'm having the exact same
I'm having the exact same problem...
I'm getting a: "Vocabulary import failed: file was not uploaded."
It seems that the file field is not receiving the value that is passed.
Any help would be very appreciated.
I found a workaround for our
I found a workaround for our case, if the file we want to be imported is already in the server, we don't need to use "taxomomy_xml_import_form", you just have to call the function that actually parses the XML, you can do this:
This piece of code should create your vocabs.