diff --git a/core/modules/field/src/ConfigImporterFieldPurger.php b/core/modules/field/src/ConfigImporterFieldPurger.php index 63bd3a0..43ab00e 100644 --- a/core/modules/field/src/ConfigImporterFieldPurger.php +++ b/core/modules/field/src/ConfigImporterFieldPurger.php @@ -138,9 +138,10 @@ public static function getFieldStoragesToPurge(array $extensions, array $deletes } // Gather deleted fields from modules that are being uninstalled. + /** @var \Drupal\field\FieldStorageConfigInterface[] $field_storages */ $field_storages = entity_load_multiple_by_properties('field_storage_config', array('deleted' => TRUE, 'include_deleted' => TRUE)); foreach ($field_storages as $field_storage) { - if (!in_array($field_storage->getModule(), $providers)) { + if (!in_array($field_storage->getFieldTypeProvider(), $providers)) { $storages_to_delete[$field_storage->id()] = $field_storage; } } diff --git a/core/modules/field/src/Entity/FieldStorageConfig.php b/core/modules/field/src/Entity/FieldStorageConfig.php index 7907ef0..f116f7e 100644 --- a/core/modules/field/src/Entity/FieldStorageConfig.php +++ b/core/modules/field/src/Entity/FieldStorageConfig.php @@ -324,7 +324,7 @@ protected function preSaveNew(EntityStorageInterface $storage) { public function calculateDependencies() { parent::calculateDependencies(); // Ensure the field is dependent on the providing module. - $this->addDependency('module', $this->getModule()); + $this->addDependency('module', $this->getFieldTypeProvider()); // Ensure the field is dependent on the provider of the entity type. $entity_type = \Drupal::entityManager()->getDefinition($this->entity_type); $this->addDependency('module', $entity_type->getProvider()); @@ -513,7 +513,7 @@ public function isDeleted() { /** * {@inheritdoc} */ - public function getModule() { + public function getFieldTypeProvider() { return $this->module; } @@ -821,4 +821,5 @@ public function setIndexes($indexes) { $this->indexes = $indexes; return $this; } + } diff --git a/core/modules/field/src/FieldStorageConfigInterface.php b/core/modules/field/src/FieldStorageConfigInterface.php index c7a7da8..d76009a 100644 --- a/core/modules/field/src/FieldStorageConfigInterface.php +++ b/core/modules/field/src/FieldStorageConfigInterface.php @@ -95,7 +95,7 @@ public function setSettings($settings); * @return string * The name of the module that provides the field type. */ - public function getModule(); + public function getFieldTypeProvider(); /** * Sets whether the field is translatable. diff --git a/core/modules/field/src/FieldStorageConfigStorage.php b/core/modules/field/src/FieldStorageConfigStorage.php index 0f4bdba..3787f88 100644 --- a/core/modules/field/src/FieldStorageConfigStorage.php +++ b/core/modules/field/src/FieldStorageConfigStorage.php @@ -104,6 +104,7 @@ public function loadByProperties(array $conditions = array()) { $include_deleted = isset($conditions['include_deleted']) ? $conditions['include_deleted'] : FALSE; unset($conditions['include_deleted']); + /** @var \Drupal\field\FieldStorageConfigInterface[] $storages */ $storages = array(); // Get field storages living in configuration. If we are explicitly looking @@ -144,7 +145,7 @@ public function loadByProperties(array $conditions = array()) { break; case 'module': - $checked_value = $field->getModule(); + $checked_value = $field->getFieldTypeProvider(); break; case 'type': diff --git a/core/modules/field_ui/src/Form/FieldStorageEditForm.php b/core/modules/field_ui/src/Form/FieldStorageEditForm.php index 9c1df19..443734c 100644 --- a/core/modules/field_ui/src/Form/FieldStorageEditForm.php +++ b/core/modules/field_ui/src/Form/FieldStorageEditForm.php @@ -150,7 +150,7 @@ public function buildForm(array $form, FormStateInterface $form_state, FieldConf // Build the non-configurable field values. $form['field_storage']['field_name'] = array('#type' => 'value', '#value' => $field_storage->getName()); $form['field_storage']['type'] = array('#type' => 'value', '#value' => $field_storage->getType()); - $form['field_storage']['module'] = array('#type' => 'value', '#value' => $field_storage->getModule()); + $form['field_storage']['module'] = array('#type' => 'value', '#value' => $field_storage->getFieldTypeProvider()); $form['field_storage']['translatable'] = array('#type' => 'value', '#value' => $field_storage->isTranslatable()); $form['actions'] = array('#type' => 'actions'); diff --git a/core/modules/options/options.module b/core/modules/options/options.module index 9264a24..65c0578 100644 --- a/core/modules/options/options.module +++ b/core/modules/options/options.module @@ -106,7 +106,7 @@ function options_allowed_values(FieldStorageDefinitionInterface $definition, Fie * Implements hook_field_storage_config_update_forbid(). */ function options_field_storage_config_update_forbid(FieldStorageConfigInterface $field_storage, FieldStorageConfigInterface $prior_field_storage) { - if ($field_storage->getModule() == 'options' && $field_storage->hasData()) { + if ($field_storage->getFieldTypeProvider() == 'options' && $field_storage->hasData()) { // Forbid any update that removes allowed values with actual data. $allowed_values = $field_storage->getSetting('allowed_values'); $prior_allowed_values = $prior_field_storage->getSetting('allowed_values'); diff --git a/core/modules/views/views.views.inc b/core/modules/views/views.views.inc index c76a02e..85af642 100644 --- a/core/modules/views/views.views.inc +++ b/core/modules/views/views.views.inc @@ -179,7 +179,7 @@ function views_views_data() { /** @var \Drupal\field\FieldStorageConfigInterface $field_storage */ foreach ($entity_manager->getStorage('field_storage_config')->loadMultiple() as $field_storage) { if (_views_field_get_entity_type_storage($field_storage)) { - $result = (array) $module_handler->invoke($field_storage->getModule(), 'field_views_data', array($field_storage)); + $result = (array) $module_handler->invoke($field_storage->getFieldTypeProvider(), 'field_views_data', array($field_storage)); if (empty($result)) { $result = views_field_default_views_data($field_storage); } @@ -211,7 +211,7 @@ function views_views_data_alter(&$data) { /** @var \Drupal\field\FieldStorageConfigInterface $field_storage */ foreach ($entity_manager->getStorage('field_storage_config')->loadMultiple() as $field_storage) { if (_views_field_get_entity_type_storage($field_storage)) { - $function = $field_storage->getModule() . '_field_views_data_views_data_alter'; + $function = $field_storage->getFieldTypeProvider() . '_field_views_data_views_data_alter'; if (function_exists($function)) { $function($data, $field_storage); }