Bläddra i källkod

makes command ot:regen-config-files ignore non-organization websites

Olivier Massot 3 år sedan
förälder
incheckning
2c3efab953
1 ändrade filer med 8 tillägg och 1 borttagningar
  1. 8 1
      ot_admin/Classes/Controller/SiteController.php

+ 8 - 1
ot_admin/Classes/Controller/SiteController.php

@@ -1770,7 +1770,9 @@ class SiteController extends ActionController
         $backupConfigDir = $_ENV['TYPO3_PATH_APP'] . "/config/bkp_sites";
 
         if (file_exists($backupConfigDir)) {
-            throw new RuntimeException('A directory or a file with this name already exist: ' . $backupConfigDir);
+            throw new RuntimeException(
+                'A directory or a file with this name already exist: ' . $backupConfigDir . '. Delete it before continuing.'
+            );
         }
 
         $this->connectionPool->getConnectionByName('Default')->beginTransaction();
@@ -1782,11 +1784,16 @@ class SiteController extends ActionController
             $websites = $this->otWebsiteRepository->getAll();
 
             foreach ($websites as $website) {
+                if (!((int)$website['organization_id'] > 0)) {
+                    continue;
+                }
+
                 $identifier = $website['subdomain'] . '_' . $website['organization_id'];
                 $configDir = $configRootDir . $identifier;
                 $configFilename = $configDir . "/config.yaml";
 
                 $siteConfig = $this->otWebsiteRepository->generateWebsiteConfiguration($website, $identifier);
+
                 $config = $siteConfig->getConfiguration();
 
                 $yamlConfig = Yaml::dump($config, 99, 2);