pimcore / generic-data-index-bundle

Other
3 stars 1 forks source link

[Bug] SearchProviderInterface `createAssetSearch` returns all elements #171

Open mattamon opened 1 week ago

mattamon commented 1 week ago

For the dependencies it does not matter if we create a AssetSearch or ElementSearch.

The AssetSearch returns all element types non the less. May also be a problem with all other searches. (Did not test everything)

public function listRequiresDependencies(
      ElementParameters $elementParameters,
      DependencyParameters $parameters,
      UserInterface $user
  ): ElementSearchResult
  {
      $search = $this->searchProvider->createAssetSearch();
      $search->addModifier(
          new RequiresFilter(
              $elementParameters->getId(),
              ElementType::tryFrom($elementParameters->getType())
          )
      );

      return $this->elementSearchService->search($search);
  }
markus-moser commented 1 week ago

It should not be possible to combine a AssetSearch model with the ElementSearchService. We need specialized interfaces for this. But as this is a BC break we need to wait for the next major release. Shouldn't be a massive problem until then.