From 40282c41334c5cbff2bb7bcc7bccd4df2f1c6600 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 27 Oct 2017 15:39:38 +0300 Subject: [PATCH] -Image language fixed --- common/models/Gallery.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/common/models/Gallery.php b/common/models/Gallery.php index d960451..98b8f58 100755 --- a/common/models/Gallery.php +++ b/common/models/Gallery.php @@ -9,6 +9,8 @@ namespace common\models; use artbox\core\models\Image; + use artbox\core\models\Language; + use yii\db\ActiveQuery; /** * Stub class Gallery @@ -29,7 +31,17 @@ 'gallery' => true, ] ) - ->with('lang') + ->with( + [ + 'lang' => function (ActiveQuery $query) { + $query->andWhere( + [ + 'language_id' => Language::getCurrent()->id, + ] + ); + }, + ] + ) ->all(); } -- libgit2 0.21.4