diff --git a/protected/humhub/modules/content/components/ContentContainerActiveRecord.php b/protected/humhub/modules/content/components/ContentContainerActiveRecord.php index bb6a060865..8e4b7351ad 100644 --- a/protected/humhub/modules/content/components/ContentContainerActiveRecord.php +++ b/protected/humhub/modules/content/components/ContentContainerActiveRecord.php @@ -192,6 +192,10 @@ abstract class ContentContainerActiveRecord extends ActiveRecord */ public function getContentContainerRecord() { + if ($this->hasAttribute('contentcontainer_id')) { + return $this->hasOne(ContentContainer::className(), ['id' => 'contentcontainer_id']); + } + return $this->hasOne(ContentContainer::className(), ['pk' => 'id']) ->andOnCondition(['class' => $this->className()]); }