list_string fields w/o required and cardinality=1 can't be saved empty
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3502235. --> Reported by: [stmh](https://www.drupal.org/user/35538) Related to !124 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>I have a list_string-field which is not mandatory and has a cardinality of 1. I can't save it without value ("- None -") as the empty value in TagifySelectWidget line 186 sets it to zero, which is not in the list of allowed values. I can see that there is a requirement of Tagify, as changing that line to an empty string let the None-tag be rendered in red, but at least I can save my form.</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <p>1. Add a list_string field to a node<br> 2. set its allowed values to some key-values, e.g</p> <pre>1|foo<br>2|bar<br>3|baz</pre><p> 3. try to create a node with that field,<br> 4. leave the field empty<br> 5. hit save</p> <p>You'll get the following form-error. <strong>The value you selected is not a valid choice.</strong></p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Not sure how core handles empty values, I can spot empty string, or `_none`, either way, it shouldn't be 0.</p>
issue