diff --git a/Neos.Media/Classes/Domain/Repository/AssetRepository.php b/Neos.Media/Classes/Domain/Repository/AssetRepository.php index 3fe7719d196..7489ef11d60 100644 --- a/Neos.Media/Classes/Domain/Repository/AssetRepository.php +++ b/Neos.Media/Classes/Domain/Repository/AssetRepository.php @@ -87,7 +87,7 @@ public function findBySearchTermOrTags($searchTerm, array $tags = [], AssetColle $constraints[] = $query->contains('tags', $tag); } $query->matching($query->logicalOr($constraints)); - $this->addAssetVariantFilterClause($query); + $this->addAssetVariantToQueryConstraints($query); $this->addAssetCollectionToQueryConstraints($query, $assetCollection); return $query->execute(); } @@ -104,7 +104,7 @@ public function findByTag(Tag $tag, AssetCollection $assetCollection = null): Qu { $query = $this->createQuery(); $query->matching($query->contains('tags', $tag)); - $this->addAssetVariantFilterClause($query); + $this->addAssetVariantToQueryConstraints($query); $this->addAssetCollectionToQueryConstraints($query, $assetCollection); return $query->execute(); } @@ -147,7 +147,7 @@ public function countByTag(Tag $tag, AssetCollection $assetCollection = null): i public function findAll(AssetCollection $assetCollection = null): QueryResultInterface { $query = $this->createQuery(); - $this->addAssetVariantFilterClause($query); + $this->addAssetVariantToQueryConstraints($query); $this->addAssetCollectionToQueryConstraints($query, $assetCollection); return $query->execute(); } @@ -188,7 +188,7 @@ public function findUntagged(AssetCollection $assetCollection = null): QueryResu { $query = $this->createQuery(); $query->matching($query->isEmpty('tags')); - $this->addAssetVariantFilterClause($query); + $this->addAssetVariantToQueryConstraints($query); $this->addAssetCollectionToQueryConstraints($query, $assetCollection); return $query->execute(); } @@ -229,7 +229,7 @@ public function countUntagged(AssetCollection $assetCollection = null): int public function findByAssetCollection(AssetCollection $assetCollection): QueryResultInterface { $query = $this->createQuery(); - $this->addAssetVariantFilterClause($query); + $this->addAssetVariantToQueryConstraints($query); $this->addAssetCollectionToQueryConstraints($query, $assetCollection); return $query->execute(); } @@ -268,9 +268,8 @@ protected function addAssetCollectionToQueryConstraints(QueryInterface $query, A return; } - $query->getQueryBuilder()->andWhere( - $query->contains('assetCollections', $assetCollection) - ); + $constraints = $query->getConstraint(); + $query->matching($query->logicalAnd([$constraints, $query->contains('assetCollections', $assetCollection)])); } /** @@ -279,14 +278,16 @@ protected function addAssetCollectionToQueryConstraints(QueryInterface $query, A * @param Query $query * @return void */ - protected function addAssetVariantFilterClause(Query $query): void + protected function addAssetVariantToQueryConstraints(QueryInterface $query): void { - $queryBuilder = $query->getQueryBuilder(); - + $variantsConstraints = []; $variantClassNames = $this->reflectionService->getAllImplementationClassNamesForInterface(AssetVariantInterface::class); foreach ($variantClassNames as $variantClassName) { - $queryBuilder->andWhere('e NOT INSTANCE OF ' . $variantClassName); + $variantsConstraints[] = 'e NOT INSTANCE OF ' . $variantClassName; } + + $constraints = $query->getConstraint(); + $query->matching($query->logicalAnd([$constraints, $query->logicalAnd($variantsConstraints)])); } /** @@ -353,7 +354,7 @@ public function findAllIterator(): IterableResult { /** @var Query $query */ $query = $this->createQuery(); - $this->addAssetVariantFilterClause($query); + $this->addAssetVariantToQueryConstraints($query); return $query->getQueryBuilder()->getQuery()->iterate(); } diff --git a/Neos.Neos/Documentation/Appendixes/ChangeLogs/7317.rst b/Neos.Neos/Documentation/Appendixes/ChangeLogs/7317.rst new file mode 100644 index 00000000000..a323dd9be01 --- /dev/null +++ b/Neos.Neos/Documentation/Appendixes/ChangeLogs/7317.rst @@ -0,0 +1,144 @@ +`7.3.17 (2023-12-12) `_ +================================================================================================ + +Overview of merged pull requests +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +`BUGFIX: Remove unnecessary basemixins dependency for ContentReferences `_ +----------------------------------------------------------------------------------------------------------------------------------------- + +The package has no direct dependency to the basemixins and should be usable without the other basemixins. + +* Packages: ``NodeTypes.ContentReferences`` + +`BUGFIX: Add workspace hash to NodeDynamicTag_ and AssetDynamicTag_ cache tags `_ +------------------------------------------------------------------------------------------------------------------------------------------------ + +* Fixes: `#4781 `_ + +* Packages: ``Neos`` + +`BUGFIX: Filter for assets by asset collection without overriding existing WHERE conditions `_ +------------------------------------------------------------------------------------------------------------------------------------------------------------- + +The query to fetch assets gets build in multiple steps. E.g in ``findAll`` it creates the query, adds the "variant filter clause" and afterwards the "asset collection filter clause". + +``` + public function findAll(AssetCollection $assetCollection = null): QueryResultInterface + { + $query = $this->createQuery(); + $this->addAssetVariantFilterClause($query); + $this->addAssetCollectionToQueryConstraints($query, $assetCollection); + return $query->execute(); + } +``` +But adding the "asset collection filter clause" removes/overrides the existing "variant filter clause" + +This fix replaces the way of setting "asset collection filter clause", so the existing where clauses are retained. + +* Fixes: `#4723 `_ + +* Packages: ``Media`` + +`BUGFIX: flashmessages in legacy modules work as expected `_ +--------------------------------------------------------------------------------------------------------------------------- + +This applies the, since a while unused, presets for message severity types to notifications in classic Neos backend modules again so that eg. warnings and errors stay on display and can be copied / screenshotted. + +Also regenerates js maps that seem to have compiled wrongly before. + +* Fixes: `#4672 `_ + +* Packages: ``Neos`` + +`BUGFIX: Check if image is possible to refit on replacement `_ +----------------------------------------------------------------------------------------------------------------------------- + +* Fixes: `#4752 `_ + +Checks if the replacement is an image and has a size. + +* Packages: ``Neos`` ``NodeTypes.BaseMixins`` ``Media`` + +`BUGFIX: Allow disabling of auto-created Image Variants `_ +------------------------------------------------------------------------------------------------------------------------- + +Fixes support for the setting ``autoCreateImageVariantPresets`` that was documented for a long time but never actually evaluated. + +This change set: + +* Adjusts ``AssetService::assetCreated()`` signal to only trigger ``AssetVariantGenerator::createVariants()`` if the ``autoCreateImageVariantPresets`` flag is set +* Sets the default value of the flag to ``true`` for greater backwards compatibility +* Adjusts ``AssetVariantGenerator::createVariant()`` to only create a variant if it does not exist already – previously multiple variants with the same identifiers could be created for a single asset leading to undeterministic behavior +* Adds a button "Create missing Variants" to the ``Variants`` tab of the Media Module allowing editors to manually trigger creation of (missing) variants. + +* Fixes: `#4300 `_ + +* Packages: ``Neos`` ``Media`` + +`BUGFIX: `props` will be unset after an exception `_ +------------------------------------------------------------------------------------------------------------------- + +* Resolves: `#4525 `_ + +The rendering in a Neos.Fusion Component had a bug where the ``props`` might be undefined if an exception happened earlier in an eel expression. + +This was caused by not correctly poping the runtimes context and thus causing a unexpected shift in the context stack. + +**Upgrade instructions** + +**Review instructions** + + +* Packages: ``Neos`` ``Fusion`` + +`TASK: Use role label in list users/new user view if available `_ +-------------------------------------------------------------------------------------------------------------------------------- + +In Neos 7 (and with https://github.com/neos/flow-development-collection/issues/2162), role labels were introduced. While we now have a nice table view in the "edit account" view, the role label is not displayed anywhere else. + +I'm aware that Neos 7 and 8 are in maintenance-only mode, but I think we all agree that Neos 8 will be around for quite a while. I suggest the minimal change to use the role label in the user list and the "new user" view if there is one. + +- [N/A] Code follows the PSR-2 coding style +- [N/A] Tests have been created, run and adjusted as needed +- [x] The PR is created against the `lowest maintained branch `_ +- [x] Reviewer - PR Title is brief but complete and starts with ``FEATURE|TASK|BUGFIX`` +- [x] Reviewer - The first section explains the change briefly for change-logs +- [N/A] Reviewer - Breaking Changes are marked with ``!!!`` and have upgrade-instructions + +* Packages: ``Neos`` + +`TASK: Adjust neos/neos css build to work on apple silicon `_ +---------------------------------------------------------------------------------------------------------------------------- + + + +* Packages: ``Neos`` + +`TASK: Add support information to package composer.json `_ +------------------------------------------------------------------------------------------------------------------------- + +The git url will be useful for automating the split configuration later. + +* Packages: ``Neos`` ``Media`` + +`TASK: Tweak dependency on neos/twitter-bootstrap `_ +------------------------------------------------------------------------------------------------------------------- + +- move the dependency from ``neos/neos`` to ``neos/media-browser`` +- change from ``*`` to ``^3.0.6`` (the first version allowing Neos 7.x) + + +* Packages: ``Neos`` ``Media.Browser`` + +`TASK: All dependencies within collection point to `self.version` `_ +----------------------------------------------------------------------------------------------------------------------------------- + +Re-adjusts dependencies to point to ``self.version`` for easier maintenance. + +* Fixes: `#4257 `_ + +* Packages: ``Neos`` + +`Detailed log `_ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/Neos.Neos/Documentation/Appendixes/ChangeLogs/8014.rst b/Neos.Neos/Documentation/Appendixes/ChangeLogs/8014.rst new file mode 100644 index 00000000000..3d5cece9e9e --- /dev/null +++ b/Neos.Neos/Documentation/Appendixes/ChangeLogs/8014.rst @@ -0,0 +1,150 @@ +`8.0.14 (2023-12-12) `_ +================================================================================================ + +Overview of merged pull requests +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +`BUGFIX: Remove unnecessary basemixins dependency for ContentReferences `_ +----------------------------------------------------------------------------------------------------------------------------------------- + +The package has no direct dependency to the basemixins and should be usable without the other basemixins. + +* Packages: ``NodeTypes.ContentReferences`` + +`BUGFIX: Add workspace hash to NodeDynamicTag_ and AssetDynamicTag_ cache tags `_ +------------------------------------------------------------------------------------------------------------------------------------------------ + +* Fixes: `#4781 `_ + +* Packages: ``Neos`` + +`BUGFIX: Filter for assets by asset collection without overriding existing WHERE conditions `_ +------------------------------------------------------------------------------------------------------------------------------------------------------------- + +The query to fetch assets gets build in multiple steps. E.g in ``findAll`` it creates the query, adds the "variant filter clause" and afterwards the "asset collection filter clause". + +``` + public function findAll(AssetCollection $assetCollection = null): QueryResultInterface + { + $query = $this->createQuery(); + $this->addAssetVariantFilterClause($query); + $this->addAssetCollectionToQueryConstraints($query, $assetCollection); + return $query->execute(); + } +``` +But adding the "asset collection filter clause" removes/overrides the existing "variant filter clause" + +This fix replaces the way of setting "asset collection filter clause", so the existing where clauses are retained. + +* Fixes: `#4723 `_ + +* Packages: ``Media`` + +`BUGFIX: flashmessages in legacy modules work as expected `_ +--------------------------------------------------------------------------------------------------------------------------- + +This applies the, since a while unused, presets for message severity types to notifications in classic Neos backend modules again so that eg. warnings and errors stay on display and can be copied / screenshotted. + +Also regenerates js maps that seem to have compiled wrongly before. + +* Fixes: `#4672 `_ + +* Packages: ``Neos`` + +`BUGFIX: Check if image is possible to refit on replacement `_ +----------------------------------------------------------------------------------------------------------------------------- + +* Fixes: `#4752 `_ + +Checks if the replacement is an image and has a size. + +* Packages: ``Neos`` ``NodeTypes.BaseMixins`` ``Media`` + +`BUGFIX: Allow disabling of auto-created Image Variants `_ +------------------------------------------------------------------------------------------------------------------------- + +Fixes support for the setting ``autoCreateImageVariantPresets`` that was documented for a long time but never actually evaluated. + +This change set: + +* Adjusts ``AssetService::assetCreated()`` signal to only trigger ``AssetVariantGenerator::createVariants()`` if the ``autoCreateImageVariantPresets`` flag is set +* Sets the default value of the flag to ``true`` for greater backwards compatibility +* Adjusts ``AssetVariantGenerator::createVariant()`` to only create a variant if it does not exist already – previously multiple variants with the same identifiers could be created for a single asset leading to undeterministic behavior +* Adds a button "Create missing Variants" to the ``Variants`` tab of the Media Module allowing editors to manually trigger creation of (missing) variants. + +* Fixes: `#4300 `_ + +* Packages: ``Neos`` ``Media`` + +`BUGFIX: `props` will be unset after an exception `_ +------------------------------------------------------------------------------------------------------------------- + +* Resolves: `#4525 `_ + +The rendering in a Neos.Fusion Component had a bug where the ``props`` might be undefined if an exception happened earlier in an eel expression. + +This was caused by not correctly poping the runtimes context and thus causing a unexpected shift in the context stack. + +**Upgrade instructions** + + +* Packages: ``Neos`` ``Fusion`` + +`TASK: Use role label in list users/new user view if available `_ +-------------------------------------------------------------------------------------------------------------------------------- + +In Neos 7 (and with https://github.com/neos/flow-development-collection/issues/2162), role labels were introduced. While we now have a nice table view in the "edit account" view, the role label is not displayed anywhere else. + +I'm aware that Neos 7 and 8 are in maintenance-only mode, but I think we all agree that Neos 8 will be around for quite a while. I suggest the minimal change to use the role label in the user list and the "new user" view if there is one. + +- [N/A] Code follows the PSR-2 coding style +- [N/A] Tests have been created, run and adjusted as needed +- [x] The PR is created against the `lowest maintained branch `_ +- [x] Reviewer - PR Title is brief but complete and starts with ``FEATURE|TASK|BUGFIX`` +- [x] Reviewer - The first section explains the change briefly for change-logs +- [N/A] Reviewer - Breaking Changes are marked with ``!!!`` and have upgrade-instructions + +* Packages: ``Neos`` + +`TASK: Add PHP 8.3 to build workflow matrix `_ +------------------------------------------------------------------------------------------------------------- + +This will test Flow against PHP 8.3 + + +* Packages: ``Neos`` ``.github`` + +`TASK: Adjust neos/neos css build to work on apple silicon `_ +---------------------------------------------------------------------------------------------------------------------------- + + + +* Packages: ``Neos`` + +`TASK: Add support information to package composer.json `_ +------------------------------------------------------------------------------------------------------------------------- + +The git url will be useful for automating the split configuration later. + +* Packages: ``Neos`` ``Media`` + +`TASK: Tweak dependency on neos/twitter-bootstrap `_ +------------------------------------------------------------------------------------------------------------------- + +- move the dependency from ``neos/neos`` to ``neos/media-browser`` +- change from ``*`` to ``^3.0.6`` (the first version allowing Neos 7.x) + + +* Packages: ``Neos`` ``Media.Browser`` + +`TASK: All dependencies within collection point to `self.version` `_ +----------------------------------------------------------------------------------------------------------------------------------- + +Re-adjusts dependencies to point to ``self.version`` for easier maintenance. + +* Fixes: `#4257 `_ + +* Packages: ``Neos`` + +`Detailed log `_ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~