Skip to content

Commit

Permalink
Fixed a SQL error that could occur when using :empty: or `:notempty…
Browse files Browse the repository at this point in the history
…:` on a relational field.
  • Loading branch information
angrybrad committed Jul 16, 2019
1 parent a8741b2 commit 535d083
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Fixed
- Fixed a JavaScript error that could occur after uploading a file directly onto an Assets field when editing the Current revision of an entry.
- Fixed a bug where draft forms could become unresponsive if the user attempted to navigate away from the page or submit the form in the middle of an autosave. ([#4578](https://github.com/craftcms/cms/issues/4578))
- Fixed a SQL error that could occur when using `:empty:` or `:notempty:` on a relational field. ([#4529](https://github.com/craftcms/cms/issues/4529))

## 3.2.3 - 2019-07-16

Expand Down
2 changes: 1 addition & 1 deletion src/elements/db/ElementQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -2542,7 +2542,7 @@ private function _applyUniqueParam(Connection $db)
$subSelectSql = str_replace($qTmpElements, $qElements, $subSelectSql);
$subSelectSql = str_replace("{$qSubElements} {$qSubElements}", "{$qElements} {$qSubElements}", $subSelectSql);

$this->subQuery->where(new Expression("[[elements_sites.id]] = ({$subSelectSql})"));
$this->subQuery->andWhere(new Expression("[[elements_sites.id]] = ({$subSelectSql})"));
}

/**
Expand Down

0 comments on commit 535d083

Please sign in to comment.