Skip to content

Commit

Permalink
Merge branch 'v3' of https://github.com/craftcms/cms into develop
Browse files Browse the repository at this point in the history
# Conflicts:
#	.gitattributes
#	CHANGELOG.md
#	composer.json
#	src/config/app.php
  • Loading branch information
brandonkelly committed Jun 24, 2022
2 parents 009c291 + b4fe5c8 commit 70b0f2a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
/package.json export-ignore
/packages/ export-ignore
/phpstan.neon export-ignore
/src/web/assets/**/src/ export-ignore
/stubs/ export-ignore
/tests/ export-ignore
/tsconfig.json export-ignore
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release Notes for Craft CMS 4

## Unreleased

### Fixed
- Fixed a SQL error that could occur on MySQL 5. ([#11493](https://github.com/craftcms/cms/issues/11493))
- Fixed a bug where Craft’s Composer commands weren’t ensuring that `config.allow-plugins.yiisoft/yii2-composer` was `true` in `composer.json`. ([#11399](https://github.com/craftcms/cms/issues/11399))

## 4.0.5.1 - 2022-06-22

### Fixed
Expand Down
9 changes: 3 additions & 6 deletions src/fields/BaseRelationField.php
Original file line number Diff line number Diff line change
Expand Up @@ -548,11 +548,7 @@ public function modifyElementsQuery(ElementQueryInterface $query, mixed $value):
'exists', (new Query())
->from(["relations_$ns" => DbTable::RELATIONS])
->innerJoin(["elements_$ns" => DbTable::ELEMENTS], "[[elements_$ns.id]] = [[relations_$ns.targetId]]")
->leftJoin(["elements_sites_$ns" => DbTable::ELEMENTS_SITES], [
'and',
"[[elements_sites_$ns.elementId]] = [[elements_$ns.id]]",
["elements_sites_$ns.siteId" => $this->_targetSiteId() ?? new Expression('[[elements_sites.siteId]]')],
])
->leftJoin(["elements_sites_$ns" => DbTable::ELEMENTS_SITES], "[[elements_sites_$ns.elementId]] = [[elements_$ns.id]]")
->where("[[relations_$ns.sourceId]] = [[elements.id]]")
->andWhere([
'or',
Expand All @@ -563,8 +559,9 @@ public function modifyElementsQuery(ElementQueryInterface $query, mixed $value):
"relations_$ns.fieldId" => $this->id,
"elements_$ns.enabled" => true,
"elements_$ns.dateDeleted" => null,
"elements_sites_$ns.siteId" => $this->_targetSiteId() ?? new Expression('[[elements_sites.siteId]]'),
"elements_sites_$ns.enabled" => true,
])
->andWhere(['not', ["elements_sites_$ns.enabled" => false]]),
];

if ($emptyCondition === ':notempty:') {
Expand Down
1 change: 1 addition & 0 deletions src/services/Composer.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ protected function ensurePluginInstallerIsAllowed(string $jsonPath): void
'config' => [
'allow-plugins' => [
'craftcms/plugin-installer' => true,
'yiisoft/yii2-composer' => true,
],
],
]);
Expand Down

0 comments on commit 70b0f2a

Please sign in to comment.