PluginSelector uses the base implementation of ::formMultipleElements(), which by default shows an empty form for fields which have multiple or unlimited cardinality. This creates a condition where the form may not allow the form to save if the user wishes to input fewer than the maximum items. The enclosed patch copies the base logic but omits this behavior, akin to paragraphs module and others which encapsulate complex subforms.

Comments

bradjones1 created an issue. See original summary.

Status: Needs review » Needs work

The last submitted patch, plugin-multiple-select.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

bradjones1’s picture

StatusFileSize
new4.48 KB
new574 bytes

Quick update to accommodate empty sets (e.g., on creation).

Haven't had a chance to look at the test fails, yet.

joachim’s picture

> The enclosed patch copies the base logic but omits this behavior, akin to paragraphs module and others which encapsulate complex subforms.

That's a LOT of base class logic we're copying! That's a bad code smell. This looks to me like we should be making a patch on core to make it easier to change just the behaviour we need to change.

bradjones1’s picture

Agreed - and I actually ran into an additional weird situation here with WidgetBase::addMoreAjax(), so agreed this is either buggy in core or we need to improve core in order to support this type of situation.