Mercurial > hg > isophonics-drupal-site
comparison core/modules/path/path.install @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4c8ae668cc8c |
---|---|
1 <?php | |
2 | |
3 /** | |
4 * @file | |
5 * Update functions for the path module. | |
6 */ | |
7 | |
8 /** | |
9 * Change the path field to computed for node and taxonomy_term. | |
10 */ | |
11 function path_update_8200() { | |
12 $entity_definition_update_manager = \Drupal::entityDefinitionUpdateManager(); | |
13 foreach (['node', 'taxonomy_term'] as $entity_type_id) { | |
14 if ($entity_definition_update_manager->getEntityType($entity_type_id)) { | |
15 // Computed field definitions are not tracked by the entity definition | |
16 // update manager, so remove them. | |
17 $storage_definition = $entity_definition_update_manager->getFieldStorageDefinition('path', $entity_type_id); | |
18 if ($storage_definition) { | |
19 $entity_definition_update_manager->uninstallFieldStorageDefinition($storage_definition); | |
20 } | |
21 } | |
22 } | |
23 } |