Problem/Motivation

Widgets that handle themselves how multi-values are presented (Entity Browser, Paragraphs, Select2, and many others) don't render a table in the format we assume in our code. As a consequence, it's useless to process them in our hook form alter, possibly causing unexpected bugs and side effects (such as #3268777: Support widgets with non-numeric form keys)

Let's make sure we skip all widgets that output form elements that we can't "simplify".

Steps to reproduce

Proposed resolution

I can see two ways of approaching this:

1- We hardcode a list of widget types/classes that we should / should not alter, or
2- We research a way of reliably identifying if the widget constructs multi-valued form elements in a structure that we are able to simplify with our JS code.

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork sam-3268790

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

marcoscano created an issue. See original summary.

  • marcoscano committed a89d7c3 on 1.0.x
    Issue #3268790 by marcoscano: Skip widgets that don't render multiple...
marcoscano’s picture

Assigned: marcoscano » Unassigned
Status: Active » Fixed

After looking a bit on possible ways to follow approach 2), I couldn't come up with a reasonable way to detect if we are safe to alter the markup or not, so I ended up hardcoding a list of widgets, as described in 1). We can always open a follow-up to refactor, in case others feel strongly about this. Also, if a contrib module provides a widget that we should support, feel free to open a ticket to add it to that list!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.