You are here

protected function ConfigImporter::processConfiguration in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Config/ConfigImporter.php \Drupal\Core\Config\ConfigImporter::processConfiguration()
  2. 9 core/lib/Drupal/Core/Config/ConfigImporter.php \Drupal\Core\Config\ConfigImporter::processConfiguration()

Processes a configuration change.

Parameters

string $collection: The configuration collection to process changes for.

string $op: The change operation.

string $name: The name of the configuration to process.

Throws

\Exception Thrown when the import process fails, only thrown when no importer log is set, otherwise the exception message is logged and the configuration is skipped.

File

core/lib/Drupal/Core/Config/ConfigImporter.php, line 780

Class

ConfigImporter
Defines a configuration importer.

Namespace

Drupal\Core\Config

Code

protected function processConfiguration($collection, $op, $name) {
  try {
    $processed = FALSE;
    if ($collection == StorageInterface::DEFAULT_COLLECTION) {
      $processed = $this
        ->importInvokeOwner($collection, $op, $name);
    }
    if (!$processed) {
      $this
        ->importConfig($collection, $op, $name);
    }
  } catch (\Exception $e) {
    $this
      ->logError($this
      ->t('Unexpected error during import with operation @op for @name: @message', [
      '@op' => $op,
      '@name' => $name,
      '@message' => $e
        ->getMessage(),
    ]));

    // Error for that operation was logged, mark it as processed so that
    // the import can continue.
    $this
      ->setProcessedConfiguration($collection, $op, $name);
  }
}