Needs review
Project:
Multi-value form element
Version:
2.0.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
30 Nov 2020 at 11:52 UTC
Updated:
2 Sep 2026 at 03:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
dieterholvoet commentedThe Field API doesn't support this either. It's being worked on though, I added the relevant issue to the related issues.
Comment #3
jane_irwinThere's a module that would serve this purpose, and it works with some other contributed modules. I've tried pairing it with Multi-value Form Element, but it doesn't work. Is that something that might be possible?
Comment #4
kakoum commentedThis module is really nice, and adding a "Delete" button would make it really useful.
Comment #5
p.kasianov commentedI did add 'remove' button. Will add patch after testing and code review on our project. Currently it was tested on D10 only.
Comment #6
hmdnawaz commented@t1mm1
Can you please add the patch or describe how you did it?
Comment #10
stijn.blomme commentedI have altered the code from the above core issue and added it to the multivalue form element.
Please test
Comment #14
super_romeo commentedNeed to replace
unset($delta_values['_weight']);with
unset($delta_values['_weight'], $delta_values['_actions']);To make the search for empty fields work properly.
Comment #15
joevagyok commentedThank you for the proposal! Test coverage for this would be much appreciated!
Comment #18
hitchshockCreated a new MR, with a clear ticket branch.
Fixed value bug, `_actions` element must be removed from the result, otherwise the empty element is determined incorrectly.
Comment #19
strykaizerIf you use the MR from this issue and you use the MR from #3199298: Don't add an empty element in some cases together, you need some extra code to make them work together.
Else the delete button will not be disabled if you have set '#add_empty' => 0,
Added extra patch for those using both patches. (This obviously wont be needed anymore once at least one of both issues is fixed).
Comment #20
darvanenComment #21
darvanenComment #22
darvanenComment #24
darvanenI've opened a fresh MR against 2.x building on the existing work in this issue (thank you!)
Tests (functional and JavaScript):
Comment #25
darvanenI found some further issues while I had this installed in a project, I've pushed a small update to the MR.