Skip to content

Commit 6dceba0

Browse files
committed
Merge remote-tracking branch 'origin/craft-4' into craft-5
# Conflicts: # CHANGELOG.md # composer.json # src/integrations/automations/WebRequest.php
2 parents 1cc3953 + fbbc2ac commit 6dceba0

File tree

2 files changed

+30
-7
lines changed

2 files changed

+30
-7
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,6 +1241,15 @@
12411241
- `Field::name` attribute has been deprecated. Use `Field::label` instead.
12421242
- `Field::inputHtml()` method has been deprecated. Use `Field::cpInputHtml()` instead.
12431243

1244+
## 2.2.11 - 2026-02-13
1245+
1246+
### Changed
1247+
- Update Phone number values sent to integrations to use `E164` format over `International`.
1248+
- Update Freshdesk “Phone” values to use international formatting.
1249+
1250+
### Fixed
1251+
- Fix an error when saving Web Request integrations.
1252+
12441253
## 2.2.10 - 2026-02-07
12451254

12461255
### Added

src/integrations/automations/WebRequest.php

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,15 @@ public static function displayName(): string
4848
public function __construct($config = [])
4949
{
5050
// Config normalization
51-
if (array_key_exists('webhook', $config)) {
52-
$config['url'] = ArrayHelper::remove($config, 'webhook');
53-
}
51+
$config = $this->_normalizeConfig($config);
5452

5553
parent::__construct($config);
5654
}
5755

5856
public function setAttributes($values, $safeOnly = true): void
5957
{
6058
// Handle legacy webhook from the form settings, which won't be via `__construct`
61-
if (array_key_exists('webhook', $values)) {
62-
$values['url'] = ArrayHelper::remove($values, 'webhook');
63-
}
59+
$values = $this->_normalizeConfig($values);
6460

6561
parent::setAttributes($values, $safeOnly);
6662
}
@@ -208,5 +204,23 @@ protected function defineClient(): Client
208204
}
209205

210206
return Craft::createGuzzleClient($config);
211-
}
207+
}
208+
209+
210+
// Private Methods
211+
// =========================================================================
212+
213+
private function _normalizeConfig(array $config): array
214+
{
215+
// Remove the legacy `webhook` key, and use the `url` key instead
216+
$legacyUrl = ArrayHelper::remove($config, 'webhook');
217+
$url = $config['url'] ?? null;
218+
219+
if ($legacyUrl && !$url) {
220+
$config['url'] = $legacyUrl;
221+
}
222+
223+
return $config;
224+
}
225+
212226
}

0 commit comments

Comments
 (0)