Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I've run into an issue where saving a node form with an empty Xero reference (Xero autocomplete widget) results in a fatal.
field.default.inc (line 38) calls drupal_array_get_nested_value() to get the value of a field and is expected to return an array. On line 41 an unset is called on the expectant array and the fatal occurs if the result was not an array.
In xero_field_autocomplete_validate(), if no value is provided in the field, then null is returned instead of an empty array - this results in the fatal. Solution appears to be return an empty array instead of null.
Patch below.
Comment | File | Size | Author |
---|---|---|---|
#1 | xero-field-default-fatal-2424081-1-D7.diff | 875 bytes | Feng-Shui |
Comments
Comment #1
Feng-Shui CreditAttribution: Feng-Shui commentedAttached patch resolves the issue for me. Thanks for the module, it's been great so far!
Comment #2
mradcliffeThanks for the patch (and the other patch). I meant to apply and review it this week, but I need to shift back to Core development for a bit.
At a brief glance, I thought this patch made sense.
Comment #3
mradcliffeCommitted to 7.x-1.x.