Skip to content

Commit

Permalink
Merge branch 'hotfix/v2.2.9'
Browse files Browse the repository at this point in the history
  • Loading branch information
ambroisemaupate committed Mar 7, 2024
2 parents 8b2041d + 3368a8f commit b096e9d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to Roadiz will be documented in this file.

## [2.2.9](https://github.com/roadiz/core-bundle-dev-app/compare/v2.2.8...v2.2.9) - 2024-03-07

### Bug Fixes

- **(AttributeValue)** Always join Node to filter out attribute values linked to not-published nodes. - ([cdd4158](https://github.com/roadiz/core-bundle-dev-app/commit/cdd41580b85f7781a4a9c4d0a7060b9e26bb0d6d))

## [2.2.8](https://github.com/roadiz/core-bundle-dev-app/compare/v2.2.7...v2.2.8) - 2024-03-07

### Bug Fixes
Expand Down Expand Up @@ -665,7 +671,7 @@ Make sure you update `config/packages/doctrine.yaml` with:
- Added NodesSourcesHeadFactoryInterface for better WebResponse and CommonContent responses maintainability. - ([ed05a24](https://github.com/roadiz/core-bundle-dev-app/commit/ed05a24947da4caa5533b37190c480b0b5358bd5))
- Updated Solr indexing tags fields for multivalued strings and use composite ID for easy overriding - ([50a04af](https://github.com/roadiz/core-bundle-dev-app/commit/50a04afc913eb1a7b67cd550fc39305598c4db19))

## [2.1.0](https://github.com/roadiz/core-bundle-dev-app/compare/v2.2.7...v2.1.0) - 2023-03-06
## [2.1.0](https://github.com/roadiz/core-bundle-dev-app/compare/v2.2.8...v2.1.0) - 2023-03-06

### Bug Fixes

Expand Down
2 changes: 1 addition & 1 deletion lib/RoadizCoreBundle/config/services.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
parameters:
roadiz_core.cms_version: '2.2.8'
roadiz_core.cms_version: '2.2.9'
roadiz_core.cms_version_prefix: 'main'
env(APP_NAMESPACE): "roadiz"
env(APP_VERSION): "0.1.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,26 +55,29 @@ private function apply(
return;
}

$parts = $queryBuilder->getDQLPart('join');
$rootAlias = $queryBuilder->getRootAliases()[0];
if (!\is_array($parts) || !isset($parts[$rootAlias])) {
return;
}

/**
* AttributeValue is always linked to a Node.
* We need to join Node to filter by its status.
*/
$existingNodeJoin = QueryBuilderHelper::getExistingJoin($queryBuilder, 'o', 'node');
if (null === $existingNodeJoin || !$existingNodeJoin->getAlias()) {
return;
$queryBuilder->leftJoin($rootAlias . '.node', 'node');
$joinAlias = 'node';
} else {
$joinAlias = $existingNodeJoin->getAlias();
}

if ($this->previewResolver->isPreview()) {
$queryBuilder
->andWhere($queryBuilder->expr()->lte($existingNodeJoin->getAlias() . '.status', ':status'))
->andWhere($queryBuilder->expr()->lte($joinAlias . '.status', ':status'))
->setParameter(':status', Node::PUBLISHED);
return;
}

$queryBuilder
->andWhere($queryBuilder->expr()->eq($existingNodeJoin->getAlias() . '.status', ':status'))
->andWhere($queryBuilder->expr()->eq($joinAlias . '.status', ':status'))
->setParameter(':status', Node::PUBLISHED);
return;
}
Expand Down

0 comments on commit b096e9d

Please sign in to comment.