Ver código fonte

Merge branch 'hotfix/V8-7104-mettre--jour-les-adresses-de-con'

Olivier Massot 6 meses atrás
pai
commit
05b5bf1f3f

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

@@ -2187,8 +2187,8 @@ class SiteController extends ActionController
                           FROM opentalent.ContactPoint c
                             INNER JOIN opentalent.organization_contactpoint o 
                             ON o.contactPoint_id = c.id
-                          WHERE c.contactType = 'PRINCIPAL' 
-                            AND o.organization_id = " . $organizationId . ";"
+                          WHERE o.organization_id = " . $organizationId . "
+                          ORDER BY FIELD(c.contactType, 'CONTACT', 'PRINCIPAL', 'BILL', 'OTHER');"
         );
         $stmt->setFetchMode(PDO::FETCH_ASSOC);
         $data['email'] = $stmt->fetch()['email'];

+ 4 - 1
ot_core/Classes/Website/OtWebsiteRepository.php

@@ -445,6 +445,9 @@ class OtWebsiteRepository
             }
         }
 
+        $website = $this->getWebsiteByPageUid($rootUid);
+        $organizationId = $website['organization_id'];
+
         $candidates = array_filter(
             scandir($configs_directory),
             function ($x) { return $x != '.' && $x != '..'; }
@@ -452,7 +455,7 @@ class OtWebsiteRepository
 
         // try to filter by directory name
         foreach ($candidates as $subdir) {
-            if (preg_match('/\.*_' . $rootUid . '$/', $subdir)) {
+            if (preg_match('/\.*_' . $organizationId . '$/', $subdir)) {
                 $filename = $configs_directory . $subdir . '/config.yaml';
                 try {
                     $yamlConfig = Yaml::parseFile($filename);