I wanted to add a file upload element with multiple uploads allowed, but restricted to a certain number (5 files).
When I add the element via Webform UI to my form and define that cardinality, it won't get saved. The help text in the form shows "unrestricted values", also when editing the element, the cardinality is set to unlimited. I could also reproduce that with a text input field as well.
I've found this issue #2871680: A managed_file field with restricted multiple values shows "Unrestricted values" in the help text and first thought, it could be related. It isn't but pointed me into the right direction:
Directly editing the source showed me, that the element's 'multiple' key is saved as boolean: '#multiple: true', When I change the boolean value to a certain number, then the chosen cardinality is respected in the webform (tried both with file upload and text input and worked)
So there's something wrong in the way the #multiple property gets saved to config
Comment | File | Size | Author |
---|---|---|---|
#2 | 2924038-restrict-cardinality-ui-1.patch | 950 bytes | jrockowitz |
|
Comments
Comment #2
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedThis is a critical issue because it affects all elements.
Comment #3
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedI am not ready to tag a full release but I think we need to do 8.x-5.0-beta24 (aka 8.x-5.0-beta23-hotifx).
@see http://cgit.drupalcode.org/webform/log/?h=8.x-5.0-beta23-hotfix
Comment #5
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #6
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commented@see https://www.drupal.org/project/webform/releases/8.x-5.0-beta24
Comment #7
agoradesign CreditAttribution: agoradesign commentedWow, that's a quick reaction :)