Commit f59d4a52 authored by osopolar's avatar osopolar Committed by Ra Mänd
Browse files

Issue #1525352 by osopolar, iKristjan, blake.thompson: Add pathauto support

parent 958c25cc
......@@ -537,6 +537,11 @@ function field_collection_field_insert($host_entity_type, $host_entity, $field,
'value' => $entity->item_id,
'revision_id' => $entity->revision_id,
);
if (module_exists('pathauto')) {
module_load_include('inc', 'field_collection', 'field_collection.pathauto');
field_collection_pathauto_create_alias($host_entity, $entity, 'insert');
}
}
}
}
......@@ -617,6 +622,11 @@ function field_collection_field_update($host_entity_type, $host_entity, $field,
'value' => $entity->item_id,
'revision_id' => $entity->revision_id,
);
if (module_exists('pathauto')) {
module_load_include('inc', 'field_collection', 'field_collection.pathauto');
field_collection_pathauto_create_alias($host_entity, $entity, 'update');
}
}
}
......@@ -656,6 +666,10 @@ function field_collection_field_update($host_entity_type, $host_entity, $field,
foreach (field_collection_item_load_multiple($items_to_remove) as $un_item) {
$un_item->updateHostEntity($host_entity, $host_entity_type);
$un_item->deleteRevision(TRUE);
if (module_exists('pathauto')) {
pathauto_entity_path_delete_all('field_collection_item', $un_item);
}
}
}
}
......@@ -699,6 +713,10 @@ function field_collection_field_delete($entity_type, $entity, $field, $instance,
$hostEntity->field_collection_deleting = TRUE;
}
}
if (module_exists('pathauto')) {
pathauto_path_delete_all('field-collection/' . str_replace('_', '-', $field['field_name']) . '/' . $id);
}
}
entity_delete_multiple('field_collection_item', $ids);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment