I have just started using Deploy (in Drupal 7) and noted that the destination node has its URL Alias reset to "automatic alias" even if there was a custom one set before (and there is also a custom one set in the source node). What is the expected behavior in terms of URL path aliases on deploy?

See also: https://www.drupal.org/node/1450902#comment-10344483

Comments

nelsonko created an issue. See original summary.

nelsonko’s picture

Issue summary: View changes
nbouhid’s picture

This is the workaround I've done to prevent this:

/**
 * Implements hook_deploy_entity_alter().
 *
 * Sets the alias to the nodes so it doesn't get lost when transferred.
 */
function yourmodule_deploy_entity_alter(&$entity, $entity_type) {
  if ($entity_type != 'node') {
    return;
  }

  $alias = drupal_get_path_alias('node/' . $entity->nid, $entity->language);
  if (empty($alias)) {
    return;
  }

  $entity->path['alias'] = $alias;
}
capogeannis’s picture

Is it possibly caused by your URL alias default pattern settings?

https://www.drupal.org/node/2454117#comment-9763099