Problem/Motivation
When paragraph types have paragraphs_categories third-party settings referencing category entities that no longer exist (or were never created), those paragraph types are grouped into phantom/non-existent category groups instead of falling back to the "Uncategorized" (_none) group.
This causes the paragraph type buttons in the modal dialog to appear in an unexpected order rather than respecting the weight/order configured in the entity reference field settings (target_bundles_drag_drop).
This can happen when:
Category entities are deleted but the paragraph type third-party settings are not cleaned up.
Configuration is imported from another environment where categories existed.
A module sets paragraphs_categories third-party settings without creating the corresponding category entities.
Steps to reproduce
Create a paragraph entity reference field with multiple paragraph types and configure their order via drag-and-drop weights.
On any paragraph type edit form, assign it to a category (e.g., layout_components).
Delete the category entity (or never create it in the first place) while the paragraph type still references it.
Edit a node with the paragraph field and open the "Add component" modal dialog.
Observe that the paragraph types do not appear in the expected field weight order — they are scattered into invisible groups.
Validate that referenced paragraph category entities actually exist before using them to group paragraph type buttons. Load all existing category entity IDs once before the loop and filter out orphaned references using array_intersect(). Paragraph types referencing non-existent categories will correctly fall back to the _none (Uncategorized) group and respect the configured field weight ordering.
Remaining tasks
Review and test the patch.
Consider whether a post_update hook should clean up orphaned paragraphs_categories third-party settings from paragraph type entities.
User interface changes
None. Paragraph type buttons will now appear in the correct order as configured in the field settings when categories are missing.
| Comment | File | Size | Author |
|---|---|---|---|
| respecting_sort_order_provided_by_user_for_uncategorized_paragraph_types.patch | 1.03 KB | yaswanth pamuru |
Issue fork paragraphs_ee-3600992
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
stborchertHi. Thanks for reporting this.
We don't do patches anymore, please create a merge request against branch 10.1.x.
Comment #5
stborchert