[Studio] Register CoreShop field types in the class definition editor - #3261
Merged
Merged
Conversation
Studio keeps two frontend registries per DataObject field type: the ObjectDataRegistry renders the value in the object editor, the FieldDefinitionRegistry drives the class definition editor and its "add field" dropdown. CoreShop only registered its 31 CoreExtension types in the first one, so the class editor showed "Type not supported" and the types could not be added through Studio at all. Every type now has a DynamicTypeFieldDefinitionCoreShop* counterpart next to its object data type, grouped under a new "CoreShop" entry in the dropdown. The abstract base, the group registration and the shared width/height/min-max form items live in PimcoreBundle because MoneyBundle, PimcoreBundle and ProductQuantityPriceRulesBundle do not depend on ResourceBundle; ResourceBundle adds the select, multiselect and relation bases on top. Form field names match the public properties of the PHP CoreExtension classes, since the class editor saves the raw field definition. Translations (en/de) follow Pimcore's field-definition.<kebab-case id> scheme including the with-prefix variants. Documentation in docs/03_Development/14_Studio/02_Base_Infrastructure/06_Dynamic_Types.md. Closes coreshop#3260
The group icon was copied from ResourceBundle's legacy logo.svg; the Studio icon library uses logo-fill.svg from CoreBundle as the CoreShop logo everywhere else. Refs coreshop#3260
coreShopMoneyCurrency extends the abstract field definition base from PimcoreBundle; composer already depends on it transitively via resource-bundle, the npm workspace dependency was missing. Refs coreshop#3260
|
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.



Closes #3260
Root cause
Studio keeps two registries per DataObject field type. CoreShop registered all its
CoreExtensiontypes only inDynamicTypes/ObjectDataRegistry(object editor) and never inDynamicTypes/FieldDefinitionRegistry(class definition editor), soLayoutFormfell through to "Type not supported" and the "add field" dropdown, which is built from the same registry via tags, had no CoreShop entries.Class editor types
Every one of the 31 field types (the 29 from the issue plus
coreShopRelation/coreShopRelations) gets aDynamicTypeFieldDefinitionCoreShop<Name>next to its object data type and is registered in each bundle'smain.ts(IndexBundle:modules/filters/module.ts) viaregisterCoreShopFieldDefinitionTypes([...]), inside the sametry/catchthat already guards the object data registry for the document editor iframe. The types appear under a new "CoreShop" group in the dropdown (registerDropdownGroupInfo, registered idempotently viagetDropdownGroupInfos()because every bundle calls it).Base classes and bundle boundaries
PimcoreBundle/.../dynamic-types/field-definitions/:DynamicTypeFieldDefinitionCoreShopAbstract(group, default icon, hides "unique"), group registration,registerCoreShopFieldDefinitionTypes(), sharedWidthFormItem/HeightFormItem/MinMaxFormItems. Lives here because MoneyBundle, PimcoreBundle and ProductQuantityPriceRulesBundle do not depend on ResourceBundle. Money and ProductQuantityPriceRules get@coreshop/pimcoreas npm dependency.ResourceBundle/.../dynamic-types/field-definitions/:...CoreShopSelect(width, allowEmpty),...CoreShopMultiselect(width, height, maxItems, renderType),...CoreShopRelation/...CoreShopRelationsextending Pimcore'sDynamicTypeFieldDefinitionManyToOne/ManyToManywith the resource stack select (options from the existing resource config endpoint) andreturnConcrete.coreShopMoney(defaultValue, min/max, nullable),coreShopMoneyCurrencyandcoreShopStoreValues(width, min/max),coreShopProductUnitDefinitions(width), the two price rule types (height),coreShopSerializedData(no settings panel) and the four DynamicDropdown variants (folderName, className from the class definition API, methodName, sortBy, recursive, onlyPublished).Form field names match the public properties of the PHP
CoreExtensionclasses, since the class editor saves the raw field definition.Translations and docs
field-definition.<kebab-case id>plus the.with-prefix.add/.with-prefix.convertvariants Pimcore uses when a type is promoted to the dropdown root, en and de, in every bundle. New labels usecoreshop_field_definition_*. New docs pagedocs/03_Development/14_Studio/02_Base_Infrastructure/06_Dynamic_Types.md(registries, base classes, registration, translations, type overview), linked from the Studio index; changelog entry under 5.1.3; CLAUDE.md section.Test
tsc --noEmitper affected bundle (14 bundles) against@pimcore/studio-ui-bundle2025.4.13: 0 errors.npm run build(rsbuild / module federation): all bundles built. Build archives are not part of this PR, the frontend build workflow commits them.allowEmpty,stack, ...).Not in this PR
The same change for 2026.x follows via the automated upmerge (the branch applies cleanly there; the 2026.x tree only differs in the two package.json files).