When a Xero reference field (Autocomplete widget) with a default value is loaded on a node form, the default value is the label of the GUID. However, when saved, the field value is cleared, presumably because the GUID validation fails. When an autocomplete result is returned from Xero it's in the format:

(Label)

If the default value is provided on the form in this value, then that value is retained on form submission, patch to come.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Feng-Shui’s picture

Attached patch alters the default value for the autocomplete widget. Results in the value being retained.

mradcliffe’s picture

Status: Active » Needs review
mradcliffe’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Status: Needs review » Fixed

Thank you for the patch. It looks like for some reason a couple of years ago I started using the label key in autocomplete, but in the simple d6 autocomplete paths it displays the contact name. I think I switch back in the current d8 branch, but at this point it would be better to keep consistent with how I did it in d7 years ago.

I committed the patch after running tests at the expected output.

  • mradcliffe committed 92bf91a on 7.x-1.x authored by Feng-Shui
    Issue #2424113 by Feng-Shui: Fix autocomplete widget default value so...

Status: Fixed » Closed (fixed)

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