From 1b6eed177406b9923c5647c618fa2b7abb4fb2f0 Mon Sep 17 00:00:00 2001 From: Sam Hibberd Date: Tue, 12 Dec 2023 09:59:12 +0000 Subject: [PATCH] Typecast BaseLocation.php $config Run the BaseLocation $config through the craft Typecast helper to address type errors when working with the map field on the front end. Craft automatically call this for any classes that extend the craft Model.php class, but not here as it extends the yii Model class directly. --- src/models/BaseLocation.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/models/BaseLocation.php b/src/models/BaseLocation.php index 3a80a42..e1bad69 100644 --- a/src/models/BaseLocation.php +++ b/src/models/BaseLocation.php @@ -9,6 +9,7 @@ namespace ether\simplemap\models; use craft\helpers\Json; +use craft\helpers\Typecast; use Twig\Markup; use yii\base\Model; @@ -44,6 +45,8 @@ abstract class BaseLocation extends Model public function __construct ($config = []) { + Typecast::properties(static::class, $config); + parent::__construct($config); if ($this->address === null)