We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9cde462 commit 67d9aafCopy full SHA for 67d9aaf
widgets/Comment.php
@@ -110,13 +110,13 @@ public function init()
110
$this->pjaxContainerId = 'comment-pjax-container-' . $this->getId();
111
}
112
113
- $this->entity = hash('crc32', get_class($this->model));
114
- $this->entityId = $this->model->{$this->entityIdAttribute};
115
-
116
- if (empty($this->entityId)) {
+ if (empty($this->model->{$this->entityIdAttribute})) {
117
throw new InvalidConfigException(Yii::t('yii2mod.comments', 'The "entityIdAttribute" value for widget model cannot be empty.'));
118
119
+ $this->entity = hash('crc32', get_class($this->model));
+ $this->entityId = $this->model->{$this->entityIdAttribute};
+
120
if (empty($this->relatedTo)) {
121
$this->relatedTo = get_class($this->model) . ':' . $this->entityId;
122
0 commit comments