You are here

function lingotek_save_pathauto_alias in Lingotek Translation 7.7

Same name and namespace in other branches
  1. 7.6 lingotek.remote.inc \lingotek_save_pathauto_alias()
1 call to lingotek_save_pathauto_alias()
lingotek_process_entity_xml in ./lingotek.remote.inc

File

./lingotek.remote.inc, line 428

Code

function lingotek_save_pathauto_alias($entity_type, $entity, $langcode) {
  list($id, $vid, $bundle) = lingotek_entity_extract_ids($entity_type, $entity);
  module_load_include('inc', 'pathauto');
  $uri = entity_uri($entity_type, $entity);
  $entity_unchanged = entity_load_unchanged($entity_type, $id);
  pathauto_create_alias($entity_type, 'update', $uri['path'], array(
    $entity_type => clone $entity_unchanged,
  ), $bundle, $langcode);
}