Skip to content

Commit 67d9aaf

Browse files
author
Igor Chepurnoy
committed
small fix
1 parent 9cde462 commit 67d9aaf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

widgets/Comment.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,13 @@ public function init()
110110
$this->pjaxContainerId = 'comment-pjax-container-' . $this->getId();
111111
}
112112

113-
$this->entity = hash('crc32', get_class($this->model));
114-
$this->entityId = $this->model->{$this->entityIdAttribute};
115-
116-
if (empty($this->entityId)) {
113+
if (empty($this->model->{$this->entityIdAttribute})) {
117114
throw new InvalidConfigException(Yii::t('yii2mod.comments', 'The "entityIdAttribute" value for widget model cannot be empty.'));
118115
}
119116

117+
$this->entity = hash('crc32', get_class($this->model));
118+
$this->entityId = $this->model->{$this->entityIdAttribute};
119+
120120
if (empty($this->relatedTo)) {
121121
$this->relatedTo = get_class($this->model) . ':' . $this->entityId;
122122
}

0 commit comments

Comments
 (0)