pimcore / generic-data-index-bundle

Other
3 stars 1 forks source link

[Bug] ElementSearchServiceInterface `byId` returns IDs only #170

Open mattamon opened 1 week ago

mattamon commented 1 week ago

The method byId of the ElementSearchServiceInterface only returns the IDs of the elements and not the element type.

Since IDs between elements are not unique in Pimcore, this causes problems if the IDs eg. of an asset, object or document are the same.

https://github.com/pimcore/generic-data-index-bundle/blob/1.x/src/Service/Search/SearchService/Element/ElementSearchService.php#L79-L81

I noticed this while implementing the dependencies for Studio Backend.

markus-moser commented 1 week ago

For the mentioned byId it should be fine because you get a search result model which indicates the element type.

But for the ElementSearchResult::getIds() you are right, this doesn't make sense without the type.