function FieldUninstallValidator::validateConfigImport

Same name and namespace in other branches
  1. 9 core/modules/field/src/FieldUninstallValidator.php \Drupal\field\FieldUninstallValidator::validateConfigImport()
  2. 11.x core/modules/field/src/FieldUninstallValidator.php \Drupal\field\FieldUninstallValidator::validateConfigImport()

Determines reasons a module can not be uninstalled prior to config import.

Parameters

string $module: A module name.

\Drupal\Core\Config\StorageInterface $source_storage: Storage object used to read configuration that is about to be imported.

Return value

string[] An array of reasons the module can not be uninstalled, empty if it can. Each reason should not end with any punctuation since multiple reasons can be displayed together.

Overrides ConfigImportModuleUninstallValidatorInterface::validateConfigImport

File

core/modules/field/src/FieldUninstallValidator.php, line 79

Class

FieldUninstallValidator
Prevents uninstallation of modules providing active field storage.

Namespace

Drupal\field

Code

public function validateConfigImport(string $module, StorageInterface $source_storage) : array {
    // The field_config_import_steps_alter() method removes field data prior to
    // configuration import so the checks in ::validate() are unnecessary.
    return [];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.