Procházet zdrojové kódy

SiteController: fix site config files resolution

Olivier Massot před 4 roky
rodič
revize
7b421acc4d
1 změnil soubory, kde provedl 2 přidání a 1 odebrání
  1. 2 1
      ot_admin/Classes/Controller/SiteController.php

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

@@ -1677,7 +1677,7 @@ class SiteController extends ActionController
 
         // try to filter by directory name
         foreach ($candidates as $subdir) {
-            if (preg_match('/\.*_' . $organizationId . '$/', $subdir)) {
+            if (preg_match('/\.*_' . $rootUid . '$/', $subdir)) {
                 $filename = $configs_directory . $subdir . '/config.yaml';
                 $yamlConfig = Yaml::parseFile($filename);
 
@@ -1689,6 +1689,7 @@ class SiteController extends ActionController
 
         // it wasn't found the easy way, let's look to each file... :(
         foreach ($candidates as $subdir) {
+            $filename = $configs_directory . $subdir . '/config.yaml';
             $yamlConfig = Yaml::parseFile($filename);
             if ($yamlConfig['rootPageId'] === $rootUid) {
                 return [$filename, $yamlConfig];