Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Chepurnoy committed Jan 6, 2017
1 parent 9cde462 commit 67d9aaf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions widgets/Comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,13 @@ public function init()
$this->pjaxContainerId = 'comment-pjax-container-' . $this->getId();
}

$this->entity = hash('crc32', get_class($this->model));
$this->entityId = $this->model->{$this->entityIdAttribute};

if (empty($this->entityId)) {
if (empty($this->model->{$this->entityIdAttribute})) {
throw new InvalidConfigException(Yii::t('yii2mod.comments', 'The "entityIdAttribute" value for widget model cannot be empty.'));
}

$this->entity = hash('crc32', get_class($this->model));
$this->entityId = $this->model->{$this->entityIdAttribute};

if (empty($this->relatedTo)) {
$this->relatedTo = get_class($this->model) . ':' . $this->entityId;
}
Expand Down

0 comments on commit 67d9aaf

Please sign in to comment.