diff --git a/pathauto_entity.module b/pathauto_entity.module index f624ea7b5d151f4ae9e61a0d9a3783c77cb37126..3cfd00e5f218a2e217c81ce0258535a804a2d1a7 100644 --- a/pathauto_entity.module +++ b/pathauto_entity.module @@ -32,6 +32,20 @@ function pathauto_entity_menu_alter(&$items) { $items['admin/config/search/path/update_bulk']['module'] = 'pathauto_entity'; } +/** + * Implements hook_module_implements_alter(). + */ +function pathauto_entity_module_implements_alter(&$implementations, $hook) { + // Both this module and file_entity implement hook_path_alias_types() and + // provide an object for 'file' entity type, which then generates nested array + // in module_invoke_all(), which uses array_merge_recursive(). To avoid this, + // let's keep only implementation from this module (as it is more generic), + // and get rid of file_entity module implementation. + if ($hook == 'path_alias_types' && isset($implementations['file_entity'])) { + unset($implementations['file_entity']); + } +} + /** * Implements hook_path_alias_types(). * @@ -56,7 +70,7 @@ function pathauto_entity_path_alias_types() { // Commerce entities, where 'commerce_product' entity types have URIs // like /admin/commerce/products/). $entity_info = entity_get_info($entity_type); - $objects[$entity_type . '/'] = t($entity_info['label']); + $objects[$entity_type . '/'] = !empty($entity_info['plural label']) ? t($entity_info['plural label']) : t($entity_info['label']); // For those entity types with different URIs, we might also want to // expose their bundles to the deletion form, and also try to generate