-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
Description
The blokkli editor UI allows dragging/dropping fragments into BlokkliField components even when the underlying Drupal field does not have blokkli_fragment in its target_bundles configuration. The editor should check the field's allowedBundles before showing fragments as droppable options.
Steps to Reproduce
- Create a Drupal paragraph field that does NOT include
blokkli_fragmentin itstarget_bundles(e.g., a field that only allowstext,image,video) - Define a frontend fragment using
defineBlokkliFragment():defineBlokkliFragment({ name: 'my_fragment', label: 'My Fragment', })
- Open the blokkli editor on a page with a
BlokkliFieldfor that field - Try to add a fragment via the "Add" menu or drag-and-drop
Expected Behavior
- Fragments should NOT appear in the "Add" menu for fields that don't allow
blokkli_fragment - Drag-and-drop of fragments should be rejected for fields that don't allow
blokkli_fragment - Only fields with
blokkli_fragmentin theirallowedBundles(frompbGetFieldConfigorparagraphsBlokkliAllowedTypes) should accept fragments
Actual Behavior
- Fragments can be added to any field regardless of
allowedBundles - The operation appears to succeed in the UI
- Validation errors only surface at publish time (server-side Drupal validation)
Additional Context
The :allowed-fragments prop on BlokkliField filters which specific fragment names are allowed, but it doesn't prevent fragments from being added to fields where blokkli_fragment bundle itself isn't allowed.
GraphQL data available:
paragraphsBlokkliAllowedTypesreturnsallowedTypesper fieldpbGetFieldConfigreturnsallowedBundlesper field
The editor already receives this data but doesn't use it to filter fragment availability.
Environment
@blokkli/editor: 2.0.0-alpha.31drupal/paragraphs_blokkli: 2.0.x-dev- Nuxt 4
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels