From d3b044452e5a501897eb72e769e6873d9c054527 Mon Sep 17 00:00:00 2001 From: Vadim Sichkarev Date: Wed, 29 May 2024 18:24:23 +0400 Subject: [PATCH] fix Getting unknown property --- framework/behaviors/AttributeTypecastBehavior.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/behaviors/AttributeTypecastBehavior.php b/framework/behaviors/AttributeTypecastBehavior.php index e2bde1b9a98..b4194634970 100644 --- a/framework/behaviors/AttributeTypecastBehavior.php +++ b/framework/behaviors/AttributeTypecastBehavior.php @@ -235,7 +235,7 @@ public function typecastAttributes($attributeNames = null) } foreach ($attributeTypes as $attribute => $type) { - $value = $this->owner->{$attribute}; + $value = $this->owner->hasAttribute($attribute) ? $this->owner->{$attribute} : null; if ($this->skipOnNull && $value === null) { continue; }