Issue Summary

Problem/Motivation

Current Problem: When fields allow multiple values (such as text fields, file uploads, references, etc.), Drupal automatically outputs the widget in a table with tabledrag functionality to allow users to reorder the values. While this reordering capability can be useful in some contexts, it creates significant problems for many use cases:

User Impact:

  • Frontend developers struggle to style multivalue fields consistently with other form elements due to the forced table structure
  • UX designers find it difficult to implement custom designs when tables with drag handles are always present
  • Site builders have no control over whether reordering is actually needed for their specific content workflows
  • End users are presented with unnecessary complexity when field order doesn't matter for their use case

Current Behavior: All multivalue fields automatically get:

  • Table-based markup with thead/tbody structure
  • Drag handles for reordering
  • Weight fields (hidden by default but present in form structure)
  • Complex JavaScript for tabledrag functionality
  • CSS that assumes table-based layout

Expected Behavior: Site builders should be able to choose whether multivalue fields need reordering capability, with those that don't need it getting simplified markup and styling that's easier to theme.

Specific Pain Points:

  • CSS frameworks and design systems struggle with the table-based markup
  • Mobile responsiveness is harder to achieve with forced table layouts
  • Accessibility can be impacted by unnecessary complexity
  • Performance overhead from tabledrag JavaScript when not needed
  • Form styling becomes inconsistent between single and multivalue fields

Steps to Reproduce

  1. Create a content type with any multivalue field (text, file, reference, etc.)
  2. Configure the field to allow multiple values
  3. Go to the form display settings for that content type
  4. Notice that there are no options to disable reordering for the multivalue field
  5. View the node add/edit form
  6. Observe the table markup, drag handles, and tabledrag JavaScript being loaded
  7. Attempt to style the field consistently with single-value fields
  8. Notice the difficulty in applying consistent styling due to table structure

Proposed Resolution

High-Level Approach: Add a new "Orderable" checkbox to the widget settings for all multivalue fields. When unchecked, the field will render with simplified markup without tables, drag handles, or weight fields.

Key Implementation Decisions:

  • Configuration Location: Add the setting to individual widget instances rather than field definitions, allowing the same field to have different behaviors on different form displays
  • Default Behavior: Keep current behavior as default (orderable enabled) to maintain backward compatibility
  • Scope: General solution that works for all multivalue widgets rather than widget-specific implementations
  • Markup Strategy: Use a simple div-based container structure when reordering is disabled
  • Theme Integration: Ensure the simplified markup works well with existing themes and is easier to style

Technical Implementation:

  • Modified the base WidgetBase class to add the orderable setting
  • Created new field-multiple-value-without-order-form.html.twig template for simplified rendering
  • Updated theme system to conditionally render table vs. simple markup
  • Implemented clean configuration schema inheritance using field.widget.settings.base
  • Ensured form validation and submission work correctly without weights

Configuration Schema Approach:

Implemented Base Type Inheritance pattern for optimal maintainability:

# Single source of truth
field.widget.settings.base:
  type: mapping
  mapping:
    orderable:
      type: boolean
      label: 'Orderable'

# Widgets inherit explicitly
field.widget.settings.string_textfield:
  type: field.widget.settings.base
  mapping:
    size: ...
    placeholder: ...

Benefits:

  • Single definition replaces 25+ individual orderable settings
  • No schema pollution for widgets that don't need ordering
  • Automatic inheritance for future widgets
  • Follows Drupal configuration best practices
  • Improved designer/developer experience for styling forms
  • Better mobile and responsive design capabilities
  • Reduced complexity and better performance when reordering isn't needed
  • Maintains full backward compatibility with existing sites
  • Provides granular control per widget instance

Remaining Tasks

Implementation Status: ✅ COMPLETE

The following tasks have been completed:

  • Technical architecture - Base inheritance pattern implemented
  • Template implementation - New template created and integrated
  • Widget base modifications - WidgetBase updated with orderable setting
  • Configuration schema - Clean inheritance using field.widget.settings.base
  • Widget coverage - 19 widgets across core and modules updated
  • Theme integration - Core themes (Claro, Stable9) support added
  • Comprehensive testing - 22+ tests with 280+ assertions passing
  • JavaScript integration - Conditional tabledrag loading
  • Form processing - Handles missing weights correctly
  • Accessibility review - Simplified markup meets standards
  • Performance validation - JavaScript and rendering improvements confirmed
  • Security review - Form processing security validated
  • Documentation - Implementation details documented in tabledrag.md

Current Tasks (if any):

Theme integration

  • Ensure compatibility with core themes
  • Add appropriate CSS classes for styling hooks
  • Document theming changes

Documentation updates

  • Update form API documentation
  • Add change record for the new functionality
  • Update developer documentation with examples
  • Accessibility review - Ensure simplified markup meets accessibility standards
  • Performance testing - Validate JavaScript and rendering improvements
  • Security review - Confirm form processing security with modified workflow
  • Final user acceptance testing
  • Potential contrib module compatibility testing

User Interface Changes

Widget Configuration (Before): Currently, multivalue widget settings show standard widget-specific options but no control over reordering behavior.

Widget Configuration (After): A new checkbox "Orderable" appears in the widget settings for any field configured to allow multiple values, with summary text showing "Orderable: Yes/No".

Form Rendering Changes:

<div class="field-multiple-table">
  <table>
    <thead>
      <tr>
        <th>Value</th>
        <th>Order</th>
      </tr>
    </thead>
    <tbody>
      <tr class="draggable">
        <td>[field widget]</td>
        <td>[drag handle + weight field]</td>
      </tr>
    </tbody>
  </table>
</div>

**After (Orderable Disabled):**

<div class="field-multiple-container">
  <div class="field-multiple-item">
    [field widget]
  </div>
  <div class="field-multiple-item">
    [field widget]
  </div>
</div>

Visual Impact: Forms with reordering disabled have cleaner, more consistent styling that matches single-value fields and is much easier to customize with CSS.

API Changes

New Widget Setting:

  • WidgetBase::defaultSettings() includes 'orderable' =&gt; TRUE
  • WidgetBase::settingsForm() includes the orderable checkbox for multivalue widgets
  • WidgetBase::settingsSummary() shows orderable status

Theme System Changes:

  • field-multiple-value-without-order-form.html.twig template for simplified rendering
  • New theme hook suggestions available for non-reorderable multivalue fields
  • Additional CSS classes for improved styling hooks
  • Template selection logic in theme preprocessing

Form Processing:

  • Form submission handling updated to work without weight values when reordering disabled
  • Validation adjusted to not expect weight fields in simplified mode
  • JavaScript conditionally loads tabledrag functionality

Configuration Schema:

  • New field.widget.settings.base type for clean inheritance
  • 19 widget definitions updated to inherit from base type
  • Reduced schema complexity from 125+ lines to ~25 lines

Backward Compatibility:

  • No breaking changes - all existing functionality remains unchanged
  • Sites can opt-in to simplified markup on a per-widget basis
  • Default behavior maintains current table-based rendering

Data Model Changes

None - This change only affects form rendering and widget configuration. No database schema changes are required.

Configuration Schema Changes: Widget configuration entities store the new orderable boolean setting through Drupal's existing configuration system without database structure changes.

Release Note Snippet

Multivalue field widgets now include an "Orderable" setting that allows site builders to disable the table-based drag-and-drop interface when field ordering is not needed. This provides cleaner markup that is easier to style and improves mobile responsiveness for multivalue fields. The feature uses a clean configuration schema inheritance pattern and maintains full backward compatibility.

How it looks

Widget settings
widget settings

Default orderable multivalue email field
orderable default

Not orderable multivalue email field
not orderable set

File field examples
not orderable set
OUTDATED:
Before:
before

After:
Only local images are allowed.

Setting:
setting

Disclosure: I used Claude to help write this issue summary, and work with me on the code contributions I made - I did check the code and test it myself - foxtrotcharlie

CommentFileSizeAuthor
#165 tabeldrag-with-empty-field.png47.69 KBdries
#162 2264739-162.patch192.48 KBjzavrl
#159 file-field-examples.png312.82 KBfoxtrotcharlie
#157 email-not-orderable2.png57.81 KBfoxtrotcharlie
#156 email-not-orderable.png44.96 KBfoxtrotcharlie
#156 email-orderable.png52.47 KBfoxtrotcharlie
#156 email-form-display-widget-settings.png52.47 KBfoxtrotcharlie
#152 2264739-152.patch48.89 KBeelkeblok
#150 core-2264739-150.patch50.4 KBbalagan
#149 2264739-149-disable-field-drag-and-drop-D11.patch51.05 KBfoxtrotcharlie
#146 2264739-146.patch49.87 KBmjmorley
#145 2264739-145.patch47.51 KBmjmorley
#141 2264739-141.patch48.43 KBwilfred waltman
#130 2264739-130-9.5.x.patch55.4 KBanneke_vde
#117 2264739-116-9.3.x.patch53 KBseanb
#114 2264739-114.patch58.56 KBlexfunk
#109 2264739-after.png20.91 KBabhijith s
#109 2264739-before.png43.16 KBabhijith s
#105 2264739-105.patch49.97 KBpasqualle
#102 interdiff_96-102.txt5.96 KBraman.b
#102 2264739-102.patch50.05 KBraman.b
#97 2264739-96.patch43.4 KBshaktik
#94 2264739-94.patch43.54 KBsanjayk
#93 interdiff_87_93.txt17.25 KBsanjayk
#93 2264739-93.patch42.63 KBsanjayk
#87 2264739-87-field_multiple_no_tabledrag.patch44.23 KBpasqualle
#86 2264739-86-field_multiple_no_tabledrag.patch42.49 KBpasqualle
#85 2264739-85-field_multiple_no_tabledrag.patch42.49 KBpasqualle
#79 2264739-79-alt-non-orderable.patch46.15 KBk4v
#76 2264739-76-alt-non-orderable.patch46.12 KBk4v
#73 2264739-73-alt-non-orderable.patch42.47 KBk4v
#72 2264739-72-alt-non-orderable-reroll-854.patch37.73 KBk4v
#67 no-tabledrag-widget-setting.png47.91 KBtacituseu
#63 2264739-61-63-interdiff.txt809 bytestacituseu
#63 2264739-63-alt-non-orderable.patch44.33 KBtacituseu
#61 2264739-59-61-interdiff.txt2.76 KBtacituseu
#61 2264739-61-alt-non-orderable.patch44.28 KBtacituseu
#59 2264739-57-59-interdiff.txt808 bytestacituseu
#59 2264739-59-alt-non-orderable.patch41.97 KBtacituseu
#57 2264739-54-57-interdiff.txt3.53 KBtacituseu
#57 2264739-57-alt-non-orderable.patch41.56 KBtacituseu
#54 2264739-50-54-interdiff.txt3.99 KBtacituseu
#54 2264739-54-alt-non-orderable.patch38.77 KBtacituseu
#50 interdiff.txt574 bytesk4v
#50 2264739-50-alt-non-orderable.patch35.79 KBk4v
#44 2264739-42-44-interdiff.txt2.05 KBtacituseu
#44 2264739-44-alt-non-orderable.patch35.75 KBtacituseu
#42 2264739-40-42-interdiff.txt7.59 KBtacituseu
#42 2264739-42-alt-non-orderable.patch33.7 KBtacituseu
#40 2264739-37-40-interdiff.txt6.97 KBtacituseu
#40 2264739-40-alt-non-orderable.patch26.1 KBtacituseu
#37 alt-non-orderable-summary.png23.68 KBtacituseu
#37 alt-non-orderable-settings.png43.38 KBtacituseu
#37 2264739-37-alt-non-orderable.patch19.83 KBtacituseu
#33 no-tabledrag-setting.png13.55 KBtacituseu
#33 no-tabledrag-after.png9.56 KBtacituseu
#33 no-tabledrag-before.png12.32 KBtacituseu
#32 interdiff.txt621 bytesMunavijayalakshmi
#32 2264739-32-allow_multiple_fields_no_tabledrag.patch33.88 KBMunavijayalakshmi
#30 2264739-18-30-interdiff.txt16.75 KBtacituseu
#30 2264739-30-allow_multiple_fields_no_tabledrag.patch33.87 KBtacituseu
#28 2264739-28-allow_multiple_fields_no_tabledrag.patch32.73 KBtacituseu
#26 2264739-26-allow_multiple_fields_no_tabledrag.patch34.41 KBtacituseu
#24 2264739-24-allow_multiple_fields_no_tabledrag.patch29.74 KBtacituseu
#20 2264739-18-20-interdiff.txt1.03 KBtacituseu
#20 2264739-20-allow_multiple_fields_no_tabledrag.patch25.51 KBtacituseu
#18 2264739-5-18-interdiff.txt10.38 KBtacituseu
#18 2264739-18-allow_multiple_fields_no_tabledrag.patch24.48 KBtacituseu
#16 2264739-16-allow_multiple_fields_no_tabledrag.patch23.32 KBtacituseu
#15 2264739-15-allow_multiple_fields_no_tabledrag.patch14.1 KBtacituseu
#8 2264739-5-allow_multiple_fields_no_tabledrag-8.0.x.patch14.15 KBgrndlvl
#7 2264739-4-allow_multiple_fields_no_tabledrag-8.0.x.patch13.09 KBgrndlvl
#4 2264739-4-allow_multiple_fields_no_tabledrag-8.0.x.patch13.09 KBgrndlvl
#3 2264739-3-allow_multiple_fields_no_tabledrag-8.0.x.patch13.06 KBgrndlvl
#2 2264739-2-allow_multiple_fields_no_tabledrag-8.0.x.patch12.5 KBgrndlvl
death-to-tabledrag.patch5.29 KBjody lynn

Issue fork drupal-2264739

Command icon 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

dcam’s picture

Version: 7.x-dev » 8.1.x-dev
Category: Task » Feature request
Status: Needs review » Active

This is a feature request and would need to be applied to the next development version.

grndlvl’s picture

OK here is the first pass for 8.0.x b/c the feature was wanted for 8.0.x.

Will need to re-create for 8.1.x-dev and write tests.

grndlvl’s picture

StatusFileSize
new13.06 KB

Re-roll for latest release

grndlvl’s picture

StatusFileSize
new13.09 KB

Re-roll for latest.

swentel’s picture

Status: Active » Needs review
Issue tags: +Needs tests

Love the idea, let's see what the bot thinks of it.
We'll probably want a test for this.

Status: Needs review » Needs work

The last submitted patch, 4: 2264739-4-allow_multiple_fields_no_tabledrag-8.0.x.patch, failed testing.

grndlvl’s picture

Allowing fallback to orderable when a contrib module overrides the WidgetBase::formMultipleElements() method.

grndlvl’s picture

Upload the right one...

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

jonathanshaw’s picture

Status: Needs work » Needs review

Run tests

Status: Needs review » Needs work

The last submitted patch, 8: 2264739-5-allow_multiple_fields_no_tabledrag-8.0.x.patch, failed testing.

jonathanshaw’s picture

Test errors are all/mostly coming from "orderable missing schema". Looks like field config schema needs updating.

tacituseu’s picture

Re-roll.

tacituseu’s picture

Status: Needs work » Needs review
StatusFileSize
new23.32 KB

Config fixes, NR just to check.

Status: Needs review » Needs work

The last submitted patch, 16: 2264739-16-allow_multiple_fields_no_tabledrag.patch, failed testing.

tacituseu’s picture

Status: Needs work » Needs review
StatusFileSize
new24.48 KB
new10.38 KB

Status: Needs review » Needs work

The last submitted patch, 18: 2264739-18-allow_multiple_fields_no_tabledrag.patch, failed testing.

tacituseu’s picture

StatusFileSize
new25.51 KB
new1.03 KB

Can't say I agree with the implementation, doesn't really fit with 'cardinality', 'revisionable', 'translatable'.
Feels like it could be simpler, contained within Drupal\Core\Field\WidgetBase and 'settings'. Thoughts ?

tacituseu’s picture

Status: Needs work » Needs review

The last submitted patch, 15: 2264739-15-allow_multiple_fields_no_tabledrag.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 20: 2264739-20-allow_multiple_fields_no_tabledrag.patch, failed testing.

tacituseu’s picture

Status: Needs work » Needs review
StatusFileSize
new29.74 KB

Status: Needs review » Needs work

The last submitted patch, 24: 2264739-24-allow_multiple_fields_no_tabledrag.patch, failed testing.

tacituseu’s picture

Status: Needs work » Needs review
StatusFileSize
new34.41 KB

Seems AssertConfigTrait::assertConfigDiff() is order sensitive.
Still not ready, will make interdiff for green patch.

Status: Needs review » Needs work

The last submitted patch, 26: 2264739-26-allow_multiple_fields_no_tabledrag.patch, failed testing.

tacituseu’s picture

Status: Needs work » Needs review
StatusFileSize
new32.73 KB

Status: Needs review » Needs work

The last submitted patch, 28: 2264739-28-allow_multiple_fields_no_tabledrag.patch, failed testing.

tacituseu’s picture

Status: Needs work » Needs review
StatusFileSize
new33.87 KB
new16.75 KB

Should be green.

Munavijayalakshmi’s picture

Assigned: Unassigned » Munavijayalakshmi
Status: Needs review » Needs work
+++ b/core/modules/field_ui/src/Form/FieldConfigEditForm.php
@@ -71,6 +71,16 @@ public function form(array $form, FormStateInterface $form_state) {
+        '#description' => t('Orderable multiple fields widgets are in a table with drag and drop.'),

This should go through $this->t().

Munavijayalakshmi’s picture

Assigned: Munavijayalakshmi » Unassigned
Status: Needs work » Needs review
StatusFileSize
new33.88 KB
new621 bytes
tacituseu’s picture

tacituseu’s picture

Issue summary: View changes
jonathanshaw’s picture

I love the idea of this, but shouldn't this be a widget setting (as stated in the IS) rather than a field setting? I can imagine that sometimes for the a field I might want a simplified widget without ordering for everyday use, but in a more advanced administrator UI I might want to allow ordering. Worth discussing at least.

And if it is a field setting, I'd expect to find it next to the cardinality settings.

tacituseu’s picture

@jonathanshaw: the original issue was for 7.x and there is a widget patch buried with it so it might explain IS.
I'm not aware of any architectural reasons it is so low level and expressed similar opinion in #20.
So far just restored the functionality of the patch from #8, certainly needs some discussion and direction from field subsystem maintainers.

tacituseu’s picture

StatusFileSize
new19.83 KB
new43.38 KB
new23.68 KB

Alternative/simpler implementation attached, moved it to widget settings, no schema changes.
Doesn't cover file and image fields, neither did original.

Edit:
The reasoning behind moving it into widget settings was that I felt that placing it near cardinality (in storage settings) would imply something about the underlying storage: that you can't count on the order items will be returned from database.
What I needed though was purely visual/widget side ability to get rid of that horrid table on fields that don't need reordering.

Also, the drawback of this patch is that it relies on each widget calling its parent in ::settingsForm(), which will cause troubles with contrib (it falls back to non-orderable in those cases).

alt-non-orderable-settings.png
alt-non-orderable-summary.png

Status: Needs review » Needs work

The last submitted patch, 37: 2264739-37-alt-non-orderable.patch, failed testing.

jonathanshaw’s picture

tacituseu’s picture

Assigned: Unassigned » tacituseu
Status: Needs work » Needs review
StatusFileSize
new26.1 KB
new6.97 KB

Initial pass for schema, also fixed settings summary for fields with cardinality = 1.

Status: Needs review » Needs work

The last submitted patch, 40: 2264739-40-alt-non-orderable.patch, failed testing. View results

tacituseu’s picture

Status: Needs work » Needs review
StatusFileSize
new33.7 KB
new7.59 KB

Status: Needs review » Needs work

The last submitted patch, 42: 2264739-42-alt-non-orderable.patch, failed testing. View results

tacituseu’s picture

Status: Needs work » Needs review
StatusFileSize
new35.75 KB
new2.05 KB

Status: Needs review » Needs work

The last submitted patch, 44: 2264739-44-alt-non-orderable.patch, failed testing. View results

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

k4v’s picture

I really like this patch! It kinda works for me on a first test.

One thing I wonder: I have custom field type with multiple properties, and now I'm missing a wrapper around each item. What would be the best approach here?

tacituseu’s picture

I had a rant somewhere about there being no concept of a component in Drupal's markup (collection of widgets/elements acting together as a single input), it is visible in core especially around issues with date/date range modules.
For now in custom/complex/mixed field types I add inside FieldWidget::formElement() something like:

$element['#type'] = 'container';
$element['#theme_wrappers']['container'] = ['#attributes' => ['class' => 'container-inline']]; 

You can also use hook_field_widget_form_alter to do this.

I also have a newer version of the patch that supports file and image fields running on dev, but I'm spread a bit thin at the moment so not sure when I'll get back to this.

k4v’s picture

Thanks that sounds good. If you post the current version I could test it, maybe work on it at the sprint weekend...

k4v’s picture

StatusFileSize
new35.79 KB
new574 bytes

Here is a change that makes the patch apply to 8.4.4.

k4v’s picture

Status: Needs work » Needs review
tacituseu’s picture

@k4v: Thanks, I checked the code in dev, file/image is very 'raw' at the moment, need to refactor it before posting, will post in a day or two.

Status: Needs review » Needs work

The last submitted patch, 50: 2264739-50-alt-non-orderable.patch, failed testing. View results

tacituseu’s picture

StatusFileSize
new38.77 KB
new3.99 KB
tacituseu’s picture

Status: Needs work » Needs review

Didn't touch tests.

Status: Needs review » Needs work

The last submitted patch, 54: 2264739-54-alt-non-orderable.patch, failed testing. View results

tacituseu’s picture

Status: Needs work » Needs review
StatusFileSize
new41.56 KB
new3.53 KB

Some test fixes.

Status: Needs review » Needs work

The last submitted patch, 57: 2264739-57-alt-non-orderable.patch, failed testing. View results

tacituseu’s picture

Status: Needs work » Needs review
StatusFileSize
new41.97 KB
new808 bytes

Should be green.

Status: Needs review » Needs work

The last submitted patch, 59: 2264739-59-alt-non-orderable.patch, failed testing. View results

tacituseu’s picture

Status: Needs work » Needs review
StatusFileSize
new44.28 KB
new2.76 KB

Status: Needs review » Needs work

The last submitted patch, 61: 2264739-61-alt-non-orderable.patch, failed testing. View results

tacituseu’s picture

Assigned: tacituseu » Unassigned
Status: Needs work » Needs review
StatusFileSize
new44.33 KB
new809 bytes
k4v’s picture

thank you!

mohit1604’s picture

@tacituseu , Thanks for the patch. But while applying patch#63 terminal shows following error:

error: patch failed: core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/BooleanCheckboxWidget.php:33
error: core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/BooleanCheckboxWidget.php: patch does not apply
error: patch failed: core/modules/comment/config/schema/comment.schema.yml:14
error: core/modules/comment/config/schema/comment.schema.yml: patch does not apply

tacituseu’s picture

@Mohit Malik: Couple of string/comment changing commits went in recently, as a feature request it is rolled for 8.5.x where it applies cleanly.

tacituseu’s picture

Issue summary: View changes
StatusFileSize
new47.91 KB

Updating IS with new settings screenshot.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

k4v’s picture

Patch #63 works very well for me, would like to see this in core :).

k4v’s picture

Status: Needs review » Reviewed & tested by the community

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 63: 2264739-63-alt-non-orderable.patch, failed testing. View results

k4v’s picture

This is a reroll for Drupal 8.5.4, I removed the test additions from the now deprected base class.

k4v’s picture

StatusFileSize
new42.47 KB

Reroll for 8.6.x

hchonov’s picture

We need an update path to add the new setting to existing form display config entities.

There is a similar update in #2863188: Hardcoded result size limit in the entity reference autocomplete widget., which could be adjusted for the current issue. Additionally the Config Entity Updater should be used in the update - https://www.drupal.org/node/2949630 .

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

k4v’s picture

StatusFileSize
new46.12 KB

Just a small fix: The twig template was missing from the core/module/system/templates folder.

This patch is only for 8.5.x.

k4v’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 76: 2264739-76-alt-non-orderable.patch, failed testing. View results

k4v’s picture

StatusFileSize
new46.15 KB

Updated for 8.6

Just changed the name of the Test core/modules/field/src/Tests/FormTest.php to /core/modules/field/tests/src/Functional/FormTest.php

k4v’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 79: 2264739-79-alt-non-orderable.patch, failed testing. View results

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

pasqualle’s picture

Multi column fields look bad when the row separator is removed.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

pasqualle’s picture

StatusFileSize
new42.49 KB

Rerolled (should apply clearly to 8.8.0-beta1)

pasqualle’s picture

StatusFileSize
new42.49 KB

#85 has wrong end of file

pasqualle’s picture

Trying to fix some test failures

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

handkerchief’s picture

Thank you for all your work.
It's impressive how such a "small" feature means such an effort and over such a long period.

"Best" workaround that works for me:

/**
 * Implements hook_preprocess_HOOK().
 */
function THEMENAME_preprocess_field_multiple_value_form(&$vars) {
  // Remove tabledrag option for multivalue fields.
  if (isset($vars['table']['#tabledrag'])) {
    unset($vars['table']['#tabledrag']);
    array_pop($vars['table']['#header']);
    foreach ($vars['table']['#rows'] as &$row) {
      foreach ($row['data'] as $key => $rowrowdata) {
        if (!$rowrowdata['data']) {
          unset($row['data'][$key]);
        }
      }
    }
  }
}

Credit to: http://www.intheloftstudios.com/blog/remove-tabledrag-field-drupal-using...

joseph.olstad’s picture

The patch still applies cleanly to 8.9.x, however it needs work to run on 9.0.x and 9.1.x , some of the test files have moved around.

We need this for WCAG compliance, the tabledrag has a link that is empty and wcag flags this as an issue.

So I'm looking at this patch because I want to disable tabledrag on a multifield fieldset.

jonathanshaw’s picture

Issue tags: +Needs reroll
sanjayk’s picture

Assigned: Unassigned » sanjayk
sanjayk’s picture

StatusFileSize
new42.63 KB
new17.25 KB

Reroll the patch for D9, will work on test cases.

sanjayk’s picture

StatusFileSize
new43.54 KB
sanjayk’s picture

Assigned: sanjayk » Unassigned
shaktik’s picture

Assigned: Unassigned » shaktik
shaktik’s picture

Assigned: shaktik » Unassigned
Status: Needs work » Needs review
StatusFileSize
new43.4 KB

The patch #94 no longer to appled. so I have re-roll the patch for D9.

Status: Needs review » Needs work

The last submitted patch, 97: 2264739-96.patch, failed testing. View results

rudam’s picture

Just want to share some love to the ones in this thread, I love you all 😂

jonathanshaw’s picture

Issue tags: -Needs reroll

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

raman.b’s picture

Status: Needs work » Needs review
StatusFileSize
new50.05 KB
new5.96 KB

Resolving failed test cases from #97

jonathanshaw’s picture

#37 says:
the drawback of this patch is that it relies on each widget calling its parent in ::settingsForm(), which will cause troubles with contrib (it falls back to non-orderable in those cases).

We should fall back to orderable for backwards compatibility.

Also we need an upgrade path per #74.

I do wonder whether we should split the issue. Add the theme component in one issue, then make it the default for all widgets in another (tricky!) issue.

jonathanshaw’s picture

Status: Needs review » Needs work
pasqualle’s picture

StatusFileSize
new49.97 KB

reroll

DieterHolvoet made their first commit to this issue’s fork.

dieterholvoet’s picture

I moved the latest patch to an issue fork and added support for the #description_display. I also removed the

element wrapping the label, I don't see why that one is needed. Finally, I added a copy of the template to Claro with the new description class.

abhijith s’s picture

StatusFileSize
new43.16 KB
new20.91 KB

Applied patch #105 on 9.2.x and it works fine.The orderable checkbox is displayed in the display settings after applying this patch.Also the functionality is working fine.

Before patch;
before

After patch:
after

RTBC +1

huskey786’s picture

#105 Patch fails to apply on 8.9.13, had to go back to #87 which worked.

System Lord’s picture

I patch manually and not going to attempt this one. I'll have to wait for it in a release. Meanwhile I'm using this. Throw it into your browser inspector and see if it does the job.

form tr td {
     padding: 4px 0;
}
.node-form .field-multiple-drag a,
.tabledrag-toggle-weight-wrapper,
.node-form .draggable a.tabledrag-handle {
    display: none !important;
}

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

jedihe’s picture

The snippet from the external link (with a slight modification) at #89 works for me, thanks @handkerchief! There is, however, a small problem: all draggable tables in multi-value fields (even nested under paragraphs) are removed. For a selective removal, I modified it like this:

function THEMENAME_preprocess_field_multiple_value_form(&$vars) {
  $element = $vars['element'];
  if ($element['#field_name'] == 'field_my_field' && isset($vars['table']['#tabledrag'])) {
    unset($vars['table']['#tabledrag']);
    array_pop($vars['table']['#header']);
    foreach ($vars['table']['#rows'] as &$row) {
      foreach (array_keys($row['data']) as $key) {
        if (array_intersect($row['data'][$key]['class'] ?? [], [
          'field-multiple-drag',
          'delta-order',
        ])) {
          unset($row['data'][$key]);
        }  
      }
    }
  }
}
lexfunk’s picture

StatusFileSize
new58.56 KB

I just simply pulled the patch from the latest merge request which seems to be applying alright to 9.2.4.

Running a test against 9.3.x

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

seanB made their first commit to this issue’s fork.

seanb’s picture

Status: Needs work » Needs review
StatusFileSize
new53 KB

I updated the MR and merged in 9.3.x but not sure how I can change the MR target. I don't seem to have permissions to do that. In hindsight, I think only the creator of the MR can do that, so sorry about that. @Pasqualle could you maybe update the target branch?

Attached is a 9.3.x patch as well.

Status: Needs review » Needs work

The last submitted patch, 117: 2264739-116-9.3.x.patch, failed testing. View results

dww’s picture

@seanB: I think Gitlab / d.o integration is smoother if you rebase MRs against the target branch, instead of merging back into the fork. That's why this issue is now very hard to read with what Gitlab is saying between #116 and #117. There's always a tag saved on every force push to git.d.o, so we always have the full history.

Thanks,
-Derek

dww’s picture

p.s. Yes, there's sadly no way for most contributors to update Gitlab MR metadata, including changing the target branch or resolving threads. That requires the author of the MR or one of the core committers. We are at least discussing this as part of the Gitlab acceleration initiative, but it's not yet clear if we can do anything about it.

seanb’s picture

Yeah, sorry about that, probably should have created a new MR for 9.3. Any suggestions on what I can do to fix this particular MR and undo the mess I created?

stopopol’s picture

+1

pasqualle’s picture

Changed the target branch and hard reset (with force push) to the commit mentioned in comment #107
The diff seems to be ok-ish.
https://git.drupalcode.org/project/drupal/-/merge_requests/450/diffs

Need manual rebase and conflict fix.

Not sure about the MR history, if it will create any issue when merged.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

pasqualle’s picture

Version: 9.5.x-dev » 10.1.x-dev

pasqualle’s picture

Created new branch and MR against D10.1

Todo: There are 2 new themes in D10: olivero and starterkit_theme where the new template file should be added.

Driskell made their first commit to this issue’s fork.

driskell’s picture

Rebased both MR for 9.5.x and 10.1.x.

Remaining tasks:

- Add tests
- Add template file for olivero
- Add template file for starterkit_theme

anneke_vde’s picture

StatusFileSize
new55.4 KB

Attached is the patch version of MR 450 for those working with composer patches.

driskell’s picture

Hi @anneke_vde
You can access the composer patch you need for an MR by visiting the changes tab and adding “.diff” or “.patch” to the end of the url: https://git.drupalcode.org/project/drupal/-/merge_requests/2851/diffs.diff

Edit: It has been rightly pointed out this isn't a reliable URL to add to composer patches, and would need downloading and storing instead. Whereas patch files are consistent and reliable to use as a composer patches URL if using that method.

jedihe’s picture

@Driskell: the .diff url is very practical, but I think it'll return a different diff as the MR gets commits pushed. In order to ensure a build doesn't end up having code you didn't properly test/review, it's better to have an actual patch file.

driskell’s picture

@jedihe Ah quite right! I see now, thanks. I normally download the patch and commit it and hadn't considered that approach of direct URL. I'll edit my comment to clarify in case others see it.

anneke_vde’s picture

Thanx for the clarification, that was indeed the reason why I uploaded the patch file.

rodrigoaguilera made their first commit to this issue’s fork.

rodrigoaguilera’s picture

Added a rebase removing the template for "stable" (only stable9 remains in D10) and an attempt at fixing the failing test from last run.

Only did it for 10.1.x since is the only branch that is receiving features now.

Another thing the proposed code is not handling is the existing widgets that will be rendered as non-orderable after the change.
I found this change
https://git.drupalcode.org/project/drupal/-/commit/2c3f5743df1dc19515258...
That sets the tooltip as a mandatory setting for Drupal 11.
We should something similar here:

  • Treat non-configured widgets (orderable is null) as orderable
  • Add a entity presave that adds the default settings

Since there is no layout builder for forms modes there is no need for a hook_post_update.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

lauriii made their first commit to this issue’s fork.

dan_metille’s picture

Seems that patch does not apply to D10.2

abelass’s picture

I confirm, patch is not applicable to 10.2

wilfred waltman’s picture

StatusFileSize
new48.43 KB

The patch did not apply on 10.2 because the field.widget.settings.language_select are moved from language.schema.yml to core.entity.schema.yml.

Here is a patch that does apply to 10.2

abelass’s picture

Thanks @Wilfred Waltman , applies now perfectly

alvarito75’s picture

Confirming #141 patch works for

  • Drupal 10.2.6
  • PHP 8.2.12
andypost’s picture

Issue tags: +Needs issue summary update, +Needs change record
mjmorley’s picture

StatusFileSize
new47.51 KB

The patch from #141 works well for me on Drupal 10.2.7 and PHP 8.2.12. I have extended the patch to only build the _weight field when "orderable" is set to TRUE.

mjmorley’s picture

StatusFileSize
new49.87 KB

My last patch missed the template /core/modules/system/templates/field-multiple-value-without-order-form.html.twig so this one adds that in

foxtrotcharlie made their first commit to this issue’s fork.

foxtrotcharlie’s picture

balagan’s picture

StatusFileSize
new50.4 KB

Reroll for branch 10.5.x.

rpayanm made their first commit to this issue’s fork.

eelkeblok’s picture

StatusFileSize
new48.89 KB

The patch in #150 unfortunately resolves the merge conflict between this patch and D10.5 incorrectly. The conflict is that the FileWidget settingform introduces a warning if the upload progress PHP extension is not available. The patch in #150 removes that again.

Here is a patch for D10.5 that retains the notice.

jaydarnell’s picture

Patch #152 appears to be working well for Drupal 10.5.1 so far.

d.fisher’s picture

Patch #152 working for me too.

foxtrotcharlie’s picture

Issue summary: View changes
foxtrotcharlie’s picture

Issue summary: View changes
StatusFileSize
new52.47 KB
new52.47 KB
new44.96 KB
foxtrotcharlie’s picture

Issue summary: View changes
StatusFileSize
new57.81 KB
foxtrotcharlie’s picture

Issue summary: View changes
foxtrotcharlie’s picture

Issue summary: View changes
StatusFileSize
new312.82 KB

jzavrl made their first commit to this issue’s fork.

jzavrl’s picture

StatusFileSize
new192.48 KB

Rerolled the patch from #149 to work with latest 11.3. New MR at https://git.drupalcode.org/project/drupal/-/merge_requests/14184.patch and attached is the patch file.

marvil07 made their first commit to this issue’s fork.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

dries’s picture

StatusFileSize
new47.69 KB

Good feature. I’ve always found it strange that tabledrag was required.

Even when there are zero items and nothing to reorder, tabledrag is still present. See screenshot. Why show it until you can actually reorder something? Fixing that might be beyond the scope of this issue, but figured I'd mention it here.

foxtrotcharlie’s picture

Issue summary: View changes