node_convert_field_convert uses field_get_items to retrieves values.
Anyway field_get_items can return FALSE (when the field is an empty array).
A typical case is an optional term reference where "no value" means not even a [LANGUAGE_NONE] indexed array, the field is only an empty array.
In such a case, we don't want to artificially create index because chances are that they will be populated in unpredictable (and buggy way) (at least in ways that I don't understand).
In the taxonomy example, you will end up with ["und"][0]["tid"] => NULL but it's wrong, and the taxonomy module will then complain about Integrity constraint violation: 1048 Column tid cannot be null
The attached patch may solve this problem but it needs understanding (and probably testing too).
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 1454128-convert-empty-terms.patch | 876 bytes | drzraf |
Comments
Comment #1
drzraf commentedComment #2
alcroito commentedYep, totally makes sense to handle FALSE values gracefully. Thanks for the patch.