Skip to content

Commit bb5e526

Browse files
committed
- (Bug Fix) Fixed issue if a plugin was instantiated with settings and the settings property wasn't an instance of the settings model
1 parent 55596f6 commit bb5e526

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

core/components/BasePlugin.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,24 @@
66

77
abstract class BasePlugin extends Settings implements PluginInterface, SettingsInterface {
88

9+
public $__class__;
10+
911
protected $settings;
1012

13+
public function __construct($attributes = null)
14+
{
15+
parent::__construct($attributes);
16+
17+
$class = $this->getSettingsModelClassName();
18+
19+
if(!$this->settings instanceof $class)
20+
{
21+
$this->settings = $this->createSettingsModel($this->settings);
22+
}
23+
24+
$this->__class__ = get_class($this);
25+
}
26+
1127
public function init()
1228
{
1329

0 commit comments

Comments
 (0)