Attempted to migrate terms generated by the Forum module in core, and noticed none of the paths were added.

After digging into the issue, found that the Forum module does not follow the standard convention for taxonomy terms. Rather than creating a path of taxonomy/term/tid, it has its own format of forum/tid.

No taxonomy/term paths are ever created for forum containers, only those with a URL segment of forum.

The attached patch checks if the Forum module exists and a path of forum/tid exists, and if so, uses the path.

The module still creates an extra taxonomy/term/tid version of the path, which it shouldn't do. I'm assuming this is due to the term.inc code in the Migrate module, and most likely needs a patch too.

The Migrate module heavily relies on core's Taxonomy module, and makes the assumption that all taxonomy terms have a default path of taxonomy/term. This assumption is incorrect, as these two blocks of code from core show:

/**
 * Implements callback_entity_info_uri().
 */
function taxonomy_term_uri($term) {
  return array(
    'path' => 'taxonomy/term/' . $term->tid,
  );
}
/**
 * Implements callback_entity_info_uri().
 *
 * Entity URI callback used in forum_entity_info_alter().
 */
function forum_uri($forum) {
  return array(
    'path' => 'forum/' . $forum->tid,
  );
}

Please review the attached patch so we can at least get the proper forum paths migrated. Thanks.

CommentFileSizeAuthor
migrate_d2d-support_forum_taxonomy-1.patch810 bytessgdev

Comments

ron_s created an issue. See original summary.

sgdev’s picture

I've created a second patch for the Migrate module addressing this issue: https://www.drupal.org/project/migrate/issues/3003164

Please review both of them together, thanks.

sgdev’s picture

Warning: the patch created in Issue #3003164 is now part of the new Migrate 7.x-2.12 release.

I doubt there are many using this module anymore, but if someone did attempt to use it, there will be problems for forums without this patch.