Skip to content

Commit

Permalink
dev
Browse files Browse the repository at this point in the history
  • Loading branch information
skeeks-semenov committed Apr 17, 2020
1 parent 2b907db commit 5d42aed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/CmsSeoComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,8 @@ protected function _initDefaultCanUrl()
* Хост может быть не указан, тогда будет взят из запроса
*/
if ($this->canUrl->host == self::CANURL_DATA_FROM_MAIN_DOMAIN) {
if (\Yii::$app->cms->site && \Yii::$app->cms->site->cmsSiteMainDomain) {
$this->canUrl->host = \Yii::$app->cms->site->cmsSiteMainDomain->domain;
if (\Yii::$app->skeeks->site && \Yii::$app->skeeks->site->cmsSiteMainDomain) {
$this->canUrl->host = \Yii::$app->skeeks->site->cmsSiteMainDomain->domain;
} else {
$this->canUrl->host = null;
}
Expand All @@ -459,8 +459,8 @@ protected function _initDefaultCanUrl()
* Аналогично со схемой
*/
if ($this->canUrl->scheme == self::CANURL_DATA_FROM_MAIN_DOMAIN) {
if (\Yii::$app->cms->site && \Yii::$app->cms->site->cmsSiteMainDomain) {
$this->canUrl->scheme = \Yii::$app->cms->site->cmsSiteMainDomain->is_https ? "https" : "http";
if (\Yii::$app->skeeks->site && \Yii::$app->skeeks->site->cmsSiteMainDomain) {
$this->canUrl->scheme = \Yii::$app->skeeks->site->cmsSiteMainDomain->is_https ? "https" : "http";
} else {
$this->canUrl->scheme = null;
}
Expand Down
4 changes: 2 additions & 2 deletions src/controllers/SitemapController.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function actionOnRequest()
*/
protected function _addTrees(&$data = [])
{
$query = Tree::find()->where(['cms_site_id' => \Yii::$app->cms->site->id]);
$query = Tree::find()->where(['cms_site_id' => \Yii::$app->skeeks->site->id]);

if (\Yii::$app->seo->activeTree) {
$query->andWhere(['active' => 'Y']);
Expand Down Expand Up @@ -103,7 +103,7 @@ protected function _addElements(&$data = [])
{
$query = CmsContentElement::find()
->joinWith('cmsTree')
->andWhere([Tree::tableName() . '.cms_site_id' => \Yii::$app->cms->site->id]);
->andWhere([Tree::tableName() . '.cms_site_id' => \Yii::$app->skeeks->site->id]);


if (\Yii::$app->seo->activeContentElem) {
Expand Down

0 comments on commit 5d42aed

Please sign in to comment.