Using ajax "add another" field when updating field values (f.e. adding multiple taxonomy terms) and clicking add another item doesn't work.
Visually the page updates and a second item is added, but it's value is never submitted. Trying to add more than two items doesn't work either. It seems that the max_delta never gets added to when setting a breakpoing in the ajax submit callback method, and the value from the second item doesn't get added to the values array for the form.
Removing the call to $form_state->disableCache() in ModifyEntityValues::buildConfigrationForm (ModifyEntityValues.php:155) fixes the issue, but I assume this isn't a real solution to the problem but may serve as a start off point for further debugging.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 3094414-5.patch | 537 bytes | chr.fritsch |
| #2 | add_another-3094414-2.patch | 620 bytes | kevineinarsson |
Comments
Comment #2
kevineinarsson commentedAttached a patch for us using Composer, note that the issue still needs work and this patch might (will) break other things.
Comment #3
kevineinarsson commentedComment #4
jmaguniaWhen I clicked Add Another for an Entity Reference field it wouldn’t add additional inputs nor would it record any changes beyond the first input.
When I added a Form View and changed the entity reference from AutoComplete to Checkboxes it worked.
Adding a Correct form view is described in this module’s Readme.
Comment #5
chr.fritschRerolled the patch.
This patch is currently the same like in #3181221: Disabled cache on ModifyEntityValues form prevents paragraphs "remove" button to work. Let's trigger the tests.
Comment #6
chr.fritschI found out that the media_library widget is also not working without this fix.
@graber: Can you recall what the problem was why the cache was disabled?
Comment #7
chr.fritschI found out this was introduced in #2974237: Serialization exception when trying to edit a file/image field. It was about adding multiple images to an article in one edit step. So I tested it again with 3 images fields on a node, with different cardinalities and uploaded multiple images to every field. Everything went smoothly.
So I think it is save remove it.
Comment #8
chr.fritschIn #3181221: Disabled cache on ModifyEntityValues form prevents paragraphs "remove" button to work @pmate also said that he couldn't find any issues with file fields without the disabled cache.
@graber: Please credit @pmate in this issue.
Comment #9
pmate commentedJust wanted to say thanks for moving this through! Big thanks!
Comment #10
graber commentedYes, let's try it, worst case we'll end up with the file issue reopened after the next release.
Comment #12
graber commented