Mercurial > hg > cmmr2012-drupal-site
annotate core/modules/path/path.install @ 4:a9cd425dd02b
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:11:55 +0000 |
parents | c75dbcec494b |
children |
rev | line source |
---|---|
Chris@0 | 1 <?php |
Chris@0 | 2 |
Chris@0 | 3 /** |
Chris@0 | 4 * @file |
Chris@0 | 5 * Update functions for the path module. |
Chris@0 | 6 */ |
Chris@0 | 7 |
Chris@0 | 8 /** |
Chris@0 | 9 * Change the path field to computed for node and taxonomy_term. |
Chris@0 | 10 */ |
Chris@0 | 11 function path_update_8200() { |
Chris@0 | 12 $entity_definition_update_manager = \Drupal::entityDefinitionUpdateManager(); |
Chris@0 | 13 foreach (['node', 'taxonomy_term'] as $entity_type_id) { |
Chris@0 | 14 if ($entity_definition_update_manager->getEntityType($entity_type_id)) { |
Chris@0 | 15 // Computed field definitions are not tracked by the entity definition |
Chris@0 | 16 // update manager, so remove them. |
Chris@0 | 17 $storage_definition = $entity_definition_update_manager->getFieldStorageDefinition('path', $entity_type_id); |
Chris@0 | 18 if ($storage_definition) { |
Chris@0 | 19 $entity_definition_update_manager->uninstallFieldStorageDefinition($storage_definition); |
Chris@0 | 20 } |
Chris@0 | 21 } |
Chris@0 | 22 } |
Chris@0 | 23 } |