From 6070bf873577193c7efdec51cf5c0f0cf8e823a8 Mon Sep 17 00:00:00 2001 From: Anna Heath Date: Mon, 16 Mar 2026 12:15:42 -0700 Subject: [PATCH] Fixes #42 The Drupal version of this module wraps its (optional) pathauto logic in a module_exists() check that got left behind in the migration to Backdrop. Restoring this here so that we don't need to require the path module to be enabled for content to save successfully. --- field_collection.module | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/field_collection.module b/field_collection.module index cb9e2bc..c6c50a8 100644 --- a/field_collection.module +++ b/field_collection.module @@ -504,8 +504,10 @@ function field_collection_field_insert($host_entity_type, $host_entity, $field, 'revision_id' => $entity->revision_id, ); - module_load_include('inc', 'path'); - path_save_automatic_entity_alias($entity); + if (module_exists('path')) { + module_load_include('inc', 'path'); + path_save_automatic_entity_alias($entity); + } // This is necessary to get the $host_entity to display the new field // collection item. @@ -601,8 +603,10 @@ function field_collection_field_update($host_entity_type, $host_entity, $field, 'revision_id' => $entity->revision_id, ); - module_load_include('inc', 'path'); - path_save_automatic_entity_alias($entity); + if (module_exists('path')) { + module_load_include('inc', 'path'); + path_save_automatic_entity_alias($entity); + } // This is necessary to get the $host_entity to display the new field // collection item.