Skip to content

Commit 1b6eed1

Browse files
authored
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.
1 parent c1a9347 commit 1b6eed1

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/models/BaseLocation.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
namespace ether\simplemap\models;
1010

1111
use craft\helpers\Json;
12+
use craft\helpers\Typecast;
1213
use Twig\Markup;
1314
use yii\base\Model;
1415

@@ -44,6 +45,8 @@ abstract class BaseLocation extends Model
4445

4546
public function __construct ($config = [])
4647
{
48+
Typecast::properties(static::class, $config);
49+
4750
parent::__construct($config);
4851

4952
if ($this->address === null)

0 commit comments

Comments
 (0)