string_list fields w/o required and cardinality=1 can't be saved empty

Created on 25 January 2025, 2 days ago

Problem/Motivation

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 the 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.

Steps to reproduce

1. Add a list_string field to a node
2. set its allowed values to some key-values, e.g

1|foo
2|bar
3|baz

3. try to create a node with that field,
4. leave the field empty
5. hit save

You'll get the following form-error. The value you selected is not a valid choice.

Proposed resolution

Not sure how core handles empty values, I can spot empty string, or `_none`, either way, it shouldn't be 0.

๐Ÿ› Bug report
Status

Active

Version

1.2

Component

Code

Created by

๐Ÿ‡ฉ๐Ÿ‡ชGermany stmh

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024