Browse Source

V8-4678-fix_website_link

Olivier Massot 2 years ago
parent
commit
ab969b84d1

+ 1 - 1
sql/schema-extensions/002-view_federation_structures.sql

@@ -1,6 +1,6 @@
 CREATE OR REPLACE VIEW view_federation_structures
 AS
-    SELECT o.id, o.name, o.logo_id as logoId, o.description, o.image_id as imageId, o.principalType as type, p.otherWebsite as website,
+    SELECT o.id, o.name, o.logo_id as logoId, o.description, o.image_id as imageId, o.principalType as type, p.website as website,
            CONCAT('[', GROUP_CONCAT(COLUMN_JSON(COLUMN_CREATE(
                    'type', oa.type, 'latitude', a.latitude, 'longitude', a.longitude,
                    'streetAddress', TRIM(BOTH '\n' FROM CONCAT_WS('\n', a.streetAddress, a.streetAddressSecond, a.streetAddressThird)),

+ 2 - 2
src/Service/Organization/Utils.php

@@ -185,8 +185,8 @@ class Utils
         $parameters = $organization->getParameters();
 
         if ($parameters->getDesactivateOpentalentSiteWeb()) {
-            if ($parameters->getOtherWebsite()) {
-                return UrlBuilder::prependHttps($parameters->getOtherWebsite());
+            if ($parameters->getWebsite()) {
+                return UrlBuilder::prependHttps($parameters->getWebsite());
             }
             return null;
         }

+ 2 - 2
tests/Unit/Service/Organization/UtilsTest.php

@@ -295,7 +295,7 @@ class UtilsTest extends TestCase
 
         $parameters = $this->getMockBuilder(Parameters::class)->getMock();
         $parameters->method('getDesactivateOpentalentSiteWeb')->willReturn(true);
-        $parameters->method('getOtherWebsite')->willReturn('foo.net');
+        $parameters->method('getWebsite')->willReturn('foo.net');
 
         $organization = $this->getMockBuilder(Organization::class)->getMock();
         $organization->method('getParameters')->willReturn($parameters);
@@ -312,7 +312,7 @@ class UtilsTest extends TestCase
 
         $parameters = $this->getMockBuilder(Parameters::class)->getMock();
         $parameters->method('getDesactivateOpentalentSiteWeb')->willReturn(true);
-        $parameters->method('getOtherWebsite')->willReturn(null);
+        $parameters->method('getWebsite')->willReturn(null);
 
         $organization = $this->getMockBuilder(Organization::class)->getMock();
         $organization->method('getParameters')->willReturn($parameters);