Skip to content

Commit

Permalink
check if the module has been installed (prevents errors prior to migr…
Browse files Browse the repository at this point in the history
…ation while installing)
  • Loading branch information
cornernote committed Apr 11, 2017
1 parent 444a03f commit 8c5a459
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Audit.php
Expand Up @@ -208,6 +208,11 @@ public function init()
parent::init();
$app = Yii::$app;

// check if the module has been installed (prevents errors while installing)
if (!$this->getDb()->getTableSchema(AuditEntry::tableName())) {
return;
}

// Before action triggers a new audit entry
$app->on(Application::EVENT_BEFORE_ACTION, [$this, 'onBeforeAction']);
// After request finalizes the audit entry.
Expand Down

0 comments on commit 8c5a459

Please sign in to comment.