diff --git a/src/Drupal/Driver/Cores/Drupal7.php b/src/Drupal/Driver/Cores/Drupal7.php index 1d0f6609..a66d6518 100644 --- a/src/Drupal/Driver/Cores/Drupal7.php +++ b/src/Drupal/Driver/Cores/Drupal7.php @@ -423,7 +423,11 @@ public function termCreate(\stdClass $term) { throw new \Exception(sprintf('No "%s" vocabulary found.')); } + // Protect against a failure from hook_taxonomy_term_insert() in pathauto. + $current_path = getcwd(); + chdir(DRUPAL_ROOT); \taxonomy_term_save($term); + chdir($current_path); // Loading a term by name returns an array of term objects, but there should // only be one matching term in a testing context, so take the first match