diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b75a35..de1f00d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## 3.2.3 - 2024-04-10 + +### Fixed +- fix queries for installs with db prefix + ## 3.2.2 - 2024-03-25 ### Updated @@ -49,6 +54,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p ### Added - Craft 5 support +## 2.6.4 - 2024-04-10 + +### Fixed +- fix queries for installs with db prefix + ## 2.6.3 - 2024-03-25 ### Updated diff --git a/package.json b/package.json index 34a1d89..b2cbeec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "craft-database-translations", - "version": "3.2.2", + "version": "3.2.3", "description": "A translations plugin for Craft CMS", "scripts": { "dev": "cross-env NODE_ENV=development webpack --progress --config=webpack.config.js", diff --git a/src/models/SourceMessage.php b/src/models/SourceMessage.php index 0f1bffe..1ce8dad 100644 --- a/src/models/SourceMessage.php +++ b/src/models/SourceMessage.php @@ -136,7 +136,7 @@ public static function filter(?array $filters = []): ActiveQuery ['like', 'message', $filterValues], ['exists', (new Query()) ->from(Message::tableName()) - ->where('dp_translations_message.id = dp_translations_source_message.id') + ->where('{{%dp_translations_message}}.id = {{%dp_translations_source_message}}.id') ->andWhere(['like', 'translation', $filterValues]) ] ]); @@ -149,7 +149,7 @@ public static function filter(?array $filters = []): ActiveQuery if ($filterKey == 'missing') { $query->andWhere(['not exists', (new Query()) ->from(Message::tableName()) - ->where('dp_translations_message.id = dp_translations_source_message.id') + ->where('{{%dp_translations_message}}.id = {{%dp_translations_source_message}}.id') ->andWhere(['language' => $filterValues]) ->andWhere('translation is not null') ->andWhere('translation <> \'\'') @@ -162,8 +162,8 @@ public static function filter(?array $filters = []): ActiveQuery if (count($filterValueParts) == 2) { [$column, $direction] = $filterValueParts; if (in_array($column, DatabaseTranslations::$plugin->databaseTranslationsService->languageIds())) { - $query->join('LEFT JOIN', Message::tableName(), 'dp_translations_message.id = dp_translations_source_message.id AND dp_translations_message.language = \''.$column.'\''); - $query->orderBy("dp_translations_message.translation $direction"); + $query->join('LEFT JOIN', Message::tableName(), '{{%dp_translations_message}}.id = {{%dp_translations_source_message}}.id AND {{%dp_translations_message}}.language = \''.$column.'\''); + $query->orderBy("{{%dp_translations_message}}.translation $direction"); } else { $query->orderBy($filterValues); }