On line 253 of the i18n_field.module, you use the allowed_values to translate field values and overrides the field "#options" which automatically removes the "empty_value" (- None - and - Select at least -) from the options.

Shouldn't we pass the already build "#options" instead of the "allowed_values" in this case ?

It really breaks the normal behavior of the core "select" field.

Comments

webflo’s picture

Assigned: Unassigned » webflo
webflo’s picture

Status: Active » Needs review
StatusFileSize
new883 bytes

Doh! Here is a patch. Please review.

jose reyero’s picture

Status: Needs review » Fixed

Looks good and seems to work. Committed. Thanks.

taran2l’s picture

This patch is fixing the problem, but does not fixing source of it. I think the i18n_field module skips couple field properties and that's way we do not have empty option in select box.

On field properties translation form I have the following notices (text field with select widget) :

Cannot delete string, not found field:field_person_title:admin:description for text group field: [empty string]
Cannot delete string, not found field:field_person_title:admin:default_value for text group field: [empty string]
Cannot delete string, not found field:field_person_title:#field:label for text group field: [empty string]

Seems like description, default_value for field instance and label for field itself does not being collected properly.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.