From 30f4a649d2f28dd5fc64779ec0c5a718014a8de7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Silva?= Date: Mon, 27 Apr 2020 17:43:57 +0100 Subject: [PATCH 1/2] Update Settings.php To handle urls like: https://organization.api.crm4.dynamics.com --- src/Settings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Settings.php b/src/Settings.php index 978340a..42659fb 100644 --- a/src/Settings.php +++ b/src/Settings.php @@ -234,7 +234,7 @@ public function __construct( $settings ) { $this->proxy = ( isset( $settings["proxy"] ) ) ? $settings["proxy"] : null; if ( $this->authMode === 'OnlineFederation' ) { - $crmRegionId = $serverHostParts[1]; + $crmRegionId = array_slice($serverHostParts, -3, 1)[0]; $this->crmRegion = $this->getCrmRegion( $crmRegionId ); $this->discoveryUrl = sprintf( '%s://disco.%s.dynamics.com/XRMServices/2011/Discovery.svc', $serverUrlParts['scheme'], $crmRegionId ); From 46d9a127666129d83f521a4b80cc517faa8e2c11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Silva?= Date: Mon, 27 Apr 2020 17:57:06 +0100 Subject: [PATCH 2/2] Update Settings.php --- src/Settings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Settings.php b/src/Settings.php index 42659fb..5827671 100644 --- a/src/Settings.php +++ b/src/Settings.php @@ -234,7 +234,7 @@ public function __construct( $settings ) { $this->proxy = ( isset( $settings["proxy"] ) ) ? $settings["proxy"] : null; if ( $this->authMode === 'OnlineFederation' ) { - $crmRegionId = array_slice($serverHostParts, -3, 1)[0]; + $crmRegionId = array_slice($serverHostParts, -3, 1)[0]; $this->crmRegion = $this->getCrmRegion( $crmRegionId ); $this->discoveryUrl = sprintf( '%s://disco.%s.dynamics.com/XRMServices/2011/Discovery.svc', $serverUrlParts['scheme'], $crmRegionId );