Remove the Parent select field from vertical sortable lists and add it to vertical and horizontal sortable lists

Created on 10 February 2024, 10 months ago
Updated 23 February 2024, 9 months ago

Problem/Motivation

There are two types of manually sortable lists in Drupal, vertical where just the order is changed and vertical/horizontal where the order and hierarchy is changed. For each type there is a problem when row weights are shown.

For vertically sortable lists like for example /admin/structure/types/manage/article/form-display:

The Parent select field has the options - None -, content, and hidden. If you try to change the field's default - none - to something else, it doesn't matter if you select content or hidden. After you save the selected option remains at -none-. The select field has no actual function and purpose for the vertical reordering anyway, the numeric weight field would be enough here.

For vertically and horizontally sortable lists like for example /admin/structure/menu/manage/admin:

The only available option for sorting is a select field with numbers as options. Problem is with the selected weight option you are only able to change the vertical order. It is simply impossible to change the level in hierarchy for like in this example a menu item as well.

Steps to reproduce

1. Go to /admin/structure/types/manage/article/form-display
2. Click Show row weights
3. Try to change the weight and selected parent option for any field and save
4. Go to /admin/structure/menu/manage/admin
5. Click Show row weights
6. Try to change the order and hierarchy of one of the menu items.

Proposed resolution

1. Remove the parent select field from lists that are only manually sortable vertically (by order)
2. Add the parent select field to lists that are sortable vertically and horizontally (by order and hierarchy)

Merge request link

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component
BaseΒ  β†’

Last updated 3 minutes ago

Created by

πŸ‡©πŸ‡ͺGermany rkoller NΓΌrnberg, Germany

Live updates comments and jobs are added and updated live.
  • Accessibility

    It affects the ability of people with disabilities or special needs (such as blindness or color-blindness) to use Drupal.

  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

  • JavaScript

    Affects the content, performance, or handling of Javascript.

Sign in to follow issues

Comments & Activities

  • Issue created by @rkoller
  • πŸ‡©πŸ‡ͺGermany rkoller NΓΌrnberg, Germany

    I was not sure which component would be appropriate in this case since the issue touches several different modules. Menus are for example apply to the system module while manage form display pages apply to the field ui module. But there might be more different cases. Apologies.

  • πŸ‡«πŸ‡·France nod_ Lille

    The parent field is useful when you have a module like field_group that can add a fieldset or something where items can be nested into. Then the parent field does not display unhelpful values.

    When field_group is not enabled it does seem unnecessary I agree, the values shown in the select do not seem correct, Content and Disabled are for the region select, not the parent select.

    The manage form display (and the other manage display, block placement) are actually hierarchical interfaces with the region being a parent of the rows. I mean technically it makes sense and I agree it's not the user see, just providing some context here.

  • πŸ‡©πŸ‡ͺGermany rkoller NΓΌrnberg, Germany

    oh that aspect i haven't considered for vertically ordered lists. it looked like that the order options were sort of interchanged between vertical and hierarchic sortable lists.

    i wondered would it make sense instead of removing the parent column from pages with vertically ordered list as currently suggested in the proposed resolution instead make the display conditional? meaning in cases like a fresh install of Core only hide that parent column and in cases like a contrib module like field_group installed show it?

  • πŸ‡«πŸ‡·France nod_ Lille

    We have 2 taxonomy terms with the same name for JavaScript on d.o with different tids, sometimes they get changed automatically depending on which one is used in the autocomplete. it happens.

    I'm not sure about adding the parents column conditionally, it sounds like it'll be a headache for backwards compatibility, i'm pretty sure it's not just field_group that make use of this.

Production build 0.71.5 2024