Skip to content

Commit

Permalink
Fixed a bug when trying to select listitems with a prefix database.
Browse files Browse the repository at this point in the history
  • Loading branch information
freimutt committed Oct 15, 2019
1 parent 9266af3 commit f8f1004
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ 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/).

## 1.1.4 - 2019-10-15
### Fixed
- Fixed a bug when trying to select listitems with a prefix database.

## 1.1.3 - 2019-10-09
### Fixed
- Fixed a bug with existing installations not using the latest database schema.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "dutchheight/craft-navie",
"description": "Navigation plugin for Craft CMS 3",
"type": "craft-plugin",
"version": "1.1.3",
"version": "1.1.4",
"keywords": [
"craft",
"cms",
Expand Down
21 changes: 10 additions & 11 deletions src/elements/db/ListItemQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@

namespace dutchheight\navie\elements\db;

use dutchheight\navie\records\ListRecord;
use dutchheight\navie\records\ListItemRecord;
use dutchheight\navie\models\ListModel;

use Craft;
use craft\db\Query;
use craft\elements\db\ElementQuery;

use craft\helpers\Db;
use dutchheight\navie\elements\ListItem;
use dutchheight\navie\models\ListModel;
use dutchheight\navie\records\ListItemRecord;
use dutchheight\navie\records\ListRecord;

class ListItemQuery extends ElementQuery
{
Expand Down Expand Up @@ -176,16 +176,15 @@ public function populate($rows)
*/
protected function beforePrepare(): bool
{
$table = ListItemRecord::tableName();
$this->joinElementTable('navie_listitems');

$this->query->select([
$table . '.id',
$table . '.listId',
$table . '.elementId',
$table . '.type',
$table . '.url',
$table . '.target'
'navie_listitems.id',
'navie_listitems.listId',
'navie_listitems.elementId',
'navie_listitems.type',
'navie_listitems.url',
'navie_listitems.target'
]);

$this->_joinLinkedElement();
Expand Down

0 comments on commit f8f1004

Please sign in to comment.