use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Url;
-use Drupal\pathauto\PathautoState;
+use Drupal\pathauto\PathautoFieldItemList;
+use Drupal\pathauto\PathautoItem;
/**
* The default ignore word list.
function pathauto_entity_delete(EntityInterface $entity) {
if ($entity->hasLinkTemplate('canonical') && $entity instanceof ContentEntityInterface && $entity->hasField('path')) {
\Drupal::service('pathauto.alias_storage_helper')->deleteEntityPathAll($entity);
- $entity->path->first()->get('pathauto')->purge();
+ $entity->get('path')->first()->get('pathauto')->purge();
}
}
* Implements hook_field_info_alter().
*/
function pathauto_field_info_alter(&$info) {
- $info['path']['class'] = '\Drupal\pathauto\PathautoItem';
+ $info['path']['class'] = PathautoItem::class;
+ $info['path']['list_class'] = PathautoFieldItemList::class;
}
/**
}
}
-/**
- * Implements hook_entity_base_field_info_alter().
- */
-function pathauto_entity_base_field_info_alter(&$fields, EntityTypeInterface $entity_type) {
- if (isset($fields['path'])) {
- // Path fields need to be computed so that the pathauto state can be
- // accessed even if there is no alias being set.
- $fields['path']->setComputed(TRUE);
- }
-}
-
/**
* Validate the pattern field, to ensure it doesn't contain any characters that
* are invalid in URLs.