fix Index class dropdown to only show IndexableInterface classes#3022
Merged
dpfaffenbauer merged 4 commits intocoreshop:5.1from Apr 23, 2026
Merged
Conversation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
The
Classdropdown in the Index configuration (Studio UI) currently shows all Pimcore DataObject classes, even though only classes whose generated model implementsIndexableInterfacecan actually be indexed. The filter logic already existed inline insideIndexController::getConfigAction, but the form-schema endpoint used an unfilteredPimcoreClassChoiceType, so the Studio dropdown still exposed every class.This PR introduces a single source of truth for "indexable Pimcore classes" and consumes it from both the Form Schema and the Controller.
Change
CoreShop\Component\Index\Service\IndexableClassesProviderInterfacewith single methodgetIndexableClassNames(): array<string>.CoreShop\Bundle\IndexBundle\Service\IndexableClassesProvider— walksClassDefinition\Listingand filters byIndexableInterface(same logic that was inline in the controller).CoreShop\Bundle\IndexBundle\Form\Type\IndexablePimcoreClassChoiceType— ChoiceType that consumes the provider. Used inIndexTypeinstead of the genericPimcoreClassChoiceType.IndexController::getConfigAction— replaced the inline loop with a provider call.PimcoreClassChoiceTypein ResourceBundle stays untouched (generic API for "pick any Pimcore class" remains available for other consumers).Test plan
IndexableInterface-implementing classes (CoreShopProduct, CoreShopCategory, …) — not every DataObject in the system.GET /pimcore-studio/api/coreshop/indexes/configreturns the same filtered list as before (no behavior change on the JSON response).