I have a vocabulary with a one level hierarchy where child terms can have multiple parents. When this vocabulary is exported, a child term with say 5 parents ends up being exported as a term in the export array 5 times even though the term data itself in the array is for a single tid. When an exported file is then imported the single term with multiple parents since it is in the export multiple times ends up getting created multiple times.

While it's likely that an eventual solution to the issue lies with fixing the export code to not export a single term (tid) more than once, I have made a patch that at least addresses the issue on an import so that the term with a single tid but multiple appearances in the export file do not get created multiple times.

CommentFileSizeAuthor
taxonomy_export.inc_.patch1.16 KBjaydub
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ffasbend’s picture

Same thing here, I have taxonomy with multiple parents. I just had a look at your patch, and the following 2 lines from your patch are not necessary

+ $processed_tids = array();
.....
+ $processed_tids[] = $term->tid;

You just have to modify your proposed if statement in the following way

foreach ($taxonomy_export->terms as $key => $term) {
+ if (!array_key_exists($term->tid, $parent_tid_map)) {
....
+ }
}