Skip to content

Commit

Permalink
Merge pull request #55 from dmstr/feature/module-instance-bugfix
Browse files Browse the repository at this point in the history
Fixing module instance bug
  • Loading branch information
eluhr authored Jan 30, 2023
2 parents 44a5939 + 730e48f commit 08cd2d3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/models/crud/WidgetContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace hrzg\widget\models\crud;

use hrzg\widget\models\crud\base\Widget as BaseWidget;
use hrzg\widget\Module;
use hrzg\widget\widgets\Cell;
use JsonSchema\Validator;
use yii\behaviors\TimestampBehavior;
Expand Down Expand Up @@ -34,6 +33,11 @@ class WidgetContent extends BaseWidget
*/
public $timezone;

/**
* @var string
*/
public $module = 'widgets';

/**
* @inheritdoc
* @return array
Expand All @@ -59,7 +63,7 @@ public function init()
parent::init();

if ($this->timezone === null) {
$this->timezone = Module::getInstance()->timezone;
$this->timezone = \Yii::$app->getModule($this->module)->timezone;
}
}

Expand Down

0 comments on commit 08cd2d3

Please sign in to comment.