See attached patch. Pathauto module doesn't check the pathauto_perform_alias property of a node, and it seems there is no other code that does either, so added some here.

Comments

mikeryan’s picture

Status: Needs review » Needs work

Looks like this issue is where pathauto_perform_alias disappeared: #937674: Convert to using $node->path['pathauto'] instead of $node->path['pathauto_perform_alias'] or $node->pathauto_perform_alias. So, we should make use of $node->path['pathauto'] rather than trying to replicate the obsolete pathauto_perform_alias field.

mikeryan’s picture

Title: Pathauto inegration not working » Pathauto integration not working
Component: Miscellaneous » Pathauto
Status: Needs work » Fixed

Committed along with an example and tests. Also, example and tests committed for D6 (no change to the actual code - pathauto on D6 is still using pathauto_perform_alias).

agentrickard’s picture

Is there some reason this isn't showing up in the current dev code?

/**
 * Field handler.
 */
class MigratePathautoHandler extends MigrateDestinationHandler {
  public function __construct() {
    $this->registerTypes(array('node', 'user', 'taxonomy_term'));
  }

  /**
   * Make the destination field visible.
   */
  public function fields() {
    return array(
      'pathauto' =>
        t('Pathauto: Perform aliasing (set to 0 to prevent alias generation during migration'),
    );
  }

  public function prepare($entity, stdClass $row) {
    if (isset($entity->pathauto)) {
      if (!isset($entity->path)) {
        $entity->path = array();
      }
      $entity->path['pathauto'] = $entity->pathauto;
      unset($entity->pathauto);
    }
  }
}

See http://drupalcode.org/project/migrate_extras.git/blob_plain/refs/heads/7...

agentrickard’s picture

Status: Fixed » Active

Also getting this message after adding a default pathauto = 1 mapping.

"pathauto_perform_alias used as destination field in mapping but not in list of destination fields"

mikeryan’s picture

Status: Active » Fixed

I'm not sure what "current dev code" it's not showing up in - it's there when I download 7.x-2.x-dev, and as your link shows it's there in git.

You need to map pathauto, not pathauto_perform_alias - see comment #1. The fieldname reflects the current pathauto implementation.

agentrickard’s picture

Status: Fixed » Active

Does seem to work properly, though.

agentrickard’s picture

Status: Active » Fixed

Right, but that code doesn't match the patch in the OP, hence my confusion.

Setting back to FIXED.

Status: Fixed » Closed (fixed)

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