Skip to content

Commit 6b414a1

Browse files
committed
Fix an error for integrations used across multiple forms, where different forms enabled different data objects, and mapping lost
1 parent 49967c5 commit 6b414a1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/base/Integration.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -947,13 +947,14 @@ private function setCache(array $values): void
947947
$this->cache = [];
948948
}
949949

950-
// Shallow-merge the top-level items
950+
// Extract any settings now to prevent accidental merge issues
951+
$oldSettings = ArrayHelper::remove($this->cache, 'settings') ?? [];
952+
$newSettings = ArrayHelper::remove($values, 'settings') ?? [];
953+
954+
// Shallow-merge the top-level items (connection status, etc)
951955
$this->cache = array_merge($this->cache, $values);
952956

953957
// Merge stored and new settings (so they work across forms)
954-
$oldSettings = $this->cache['settings'] ?? [];
955-
$newSettings = $values['settings'] ?? [];
956-
957958
$this->cache['settings'] = array_merge($oldSettings, $newSettings);
958959

959960
// Add support for emoji in cached content

0 commit comments

Comments
 (0)