summaryrefslogtreecommitdiffstatshomepage
path: root/core/modules/path/path.install
blob: fba049eac91a9c13b43b60828fd2308d22516c65 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php

/**
 * @file
 * Update functions for the path module.
 */

/**
 * Change the path field to computed for node and taxonomy_term.
 */
function path_update_8200() {
  $entity_definition_update_manager = \Drupal::entityDefinitionUpdateManager();
  foreach (['node', 'taxonomy_term'] as $entity_type_id) {
    if ($entity_definition_update_manager->getEntityType($entity_type_id)) {
      // Computed field definitions are not tracked by the entity definition
      // update manager, so remove them.
      $storage_definition = $entity_definition_update_manager->getFieldStorageDefinition('path', $entity_type_id);
      if ($storage_definition) {
        $entity_definition_update_manager->uninstallFieldStorageDefinition($storage_definition);
      }
    }
  }
}