From da845f833f54eac4369f33bb694d058550bc57a0 Mon Sep 17 00:00:00 2001 From: Wietse Warendorff Date: Fri, 4 Apr 2025 16:01:32 +0200 Subject: [PATCH] cast recordKey to string --- packages/support/src/Concerns/HasCellState.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/support/src/Concerns/HasCellState.php b/packages/support/src/Concerns/HasCellState.php index f9212cd347..3460d7baf8 100644 --- a/packages/support/src/Concerns/HasCellState.php +++ b/packages/support/src/Concerns/HasCellState.php @@ -82,8 +82,9 @@ trait HasCellState return null; } - if (array_key_exists($record->getKey(), $this->cachedState)) { - return $this->cachedState[$record->getKey()]; + $recordKey = (string) $record->getKey(); + if (array_key_exists($recordKey, $this->cachedState)) { + return $this->cachedState[$recordKey]; } $state = ($this->getStateUsing !== null) ? @@ -101,7 +102,7 @@ trait HasCellState $state = $this->getDefaultState(); } - return $this->cachedState[$record->getKey()] = $state; + return $this->cachedState[$recordKey] = $state; } public function getStateFromRecord(): mixed