Allow restricting subtypes and classes in link edit panel#1078
Conversation
|
There was a problem hiding this comment.
Pull request overview
This PR extends the classic admin UI’s link edit panel to support Pimcore 11’s ability to restrict selectable link targets by element subtype (asset/document/object subtypes) and by object class, aligning the UI behavior with newer core capabilities.
Changes:
- Added configuration options to the Link class definition UI for allowed subtypes and allowed object classes.
- Passed the new restriction settings from object link tags into the link edit panel config.
- Enforced subtype/class restrictions in the link edit panel for drag & drop and item selector search.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| translations/admin_ext.en.yaml | Adds new translation keys for the new “allowed subtypes” labels. |
| public/js/pimcore/object/tags/link.js | Builds and forwards allowedSubtypes / allowedClasses config into the link edit panel. |
| public/js/pimcore/object/classes/data/link.js | Adds Link field configuration UI for subtype/class restrictions (but currently introduces a broken MultiSelect store shape). |
| public/js/pimcore/helpers.js | Applies the subtype/class restrictions in the link edit panel (DnD + search selector restrictions). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Revert .map((text) => ({text})) wrapping on all string-array stores.
Ext.ux.form.MultiSelect expects a plain 1D string array for its internal
ArrayStore conversion; passing {text} objects caused blank/broken display.
Apply the same to the new subtype stores (filter only, no map).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fix subtype/class restriction bypasses in openLinkEditPanel
- Both search buttons now share `searchRestriction` (the always-visible
inline button was missing subtype/class params, bypassing all restrictions)
- `allowedSubtypes` is null when unconfigured so the search dialog's own
defaults are not overridden for fields with no subtype config
- Folder-only subtype restriction now correctly yields an empty intersection
instead of silently falling back to all subtypes
- Explicit `data.type === "folder"` guard in `dndAllowed` for clarity
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
@kingjia90 thx for finishing this :) |
let's thank Claude and Copilot for the moment 😏 i still have to review and test it |



Now that we finally upgraded to Pimcore 11 and I can use this feature, I noticed that we forgot to support subtypes and classes in pimcore/pimcore#13173 😞
I hope that it counts as a bugfix and can still be merged.
Note
This is a reincaration of #1057, which has accidentally been merged and reverted.