Skip to content

Commit 5a7dd73

Browse files
authored
Merge pull request #4187 from craftcms/fix/4185-undefined-array-key-name
[5.x] Fix error: undefined array key for gateway change
2 parents 3ca0c93 + f9567ed commit 5a7dd73

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
## Unreleased
44

55
- Fixed a bug where newly created variants weren’t visible on Edit product screens.
6-
- Fixed a SQL error that could occur when viewing product indexes.
6+
- Fixed a SQL error that could occur when viewing product indexes.
7+
- Fixed a PHP error that occurred when applying project config changes after updating. ([#4185](https://github.com/craftcms/commerce/issues/4185))
78

89
## 5.5.0.1 - 2025-11-24
910

src/services/Gateways.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,11 @@ public function handleChangedGateway(ConfigEvent $event): void
295295
$gatewayUid = $event->tokenMatches[0];
296296
$data = $event->newValue;
297297

298+
// Bail if the data is not a valid gateway config array
299+
if (!is_array($data)) {
300+
return;
301+
}
302+
298303
$transaction = Craft::$app->getDb()->beginTransaction();
299304
try {
300305
$gatewayRecord = $this->_getGatewayRecord($gatewayUid);

0 commit comments

Comments
 (0)