Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. SystemConfigSubscriber.php

function SystemConfigSubscriber::onConfigImporterValidateSiteUUID

Checks that the configuration synchronization is valid.

This event listener checks that the system.site:uuid's in the source and target match.

Parameters

\Drupal\Core\Config\ConfigImporterEvent $event: The config import event.

File

core/modules/system/src/SystemConfigSubscriber.php, line 75

Class

SystemConfigSubscriber
System Config subscriber.

Namespace

Drupal\system

Code

public function onConfigImporterValidateSiteUUID(ConfigImporterEvent $event) {
    if (!$event->getConfigImporter()
        ->getStorageComparer()
        ->getSourceStorage()
        ->exists('system.site')) {
        $event->getConfigImporter()
            ->logError($this->t('This import does not contain system.site configuration, so has been rejected.'));
    }
    if (!$event->getConfigImporter()
        ->getStorageComparer()
        ->validateSiteUuid()) {
        $event->getConfigImporter()
            ->logError($this->t('Site UUID in source storage does not match the target storage.'));
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal