Pull merge.
[yaffs-website] / web / core / modules / system / src / SystemConfigSubscriber.php
index ddd37be37a6fbb644208ad034a2377750dfcad53..0ab0d15fc6105dd9725adfadf09edf2d36daf14f 100644 (file)
@@ -25,7 +25,7 @@ class SystemConfigSubscriber implements EventSubscriberInterface {
   /**
    * Constructs the SystemConfigSubscriber.
    *
-   * @param \Drupal\Core\Routing\RouteBuilderInterface $route_builder
+   * @param \Drupal\Core\Routing\RouteBuilderInterface $router_builder
    *   The router builder service.
    */
   public function __construct(RouteBuilderInterface $router_builder) {
@@ -68,10 +68,13 @@ class SystemConfigSubscriber implements EventSubscriberInterface {
    * This event listener checks that the system.site:uuid's in the source and
    * target match.
    *
-   * @param ConfigImporterEvent $event
+   * @param \Drupal\Core\Config\ConfigImporterEvent $event
    *   The config import event.
    */
   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.'));
     }