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.
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.
Comment | File | Size | Author |
---|---|---|---|
#1 | xero-autocomplete-default-value-2424113-1-D7.patch | 517 bytes | Feng-Shui |
Comments
Comment #1
Feng-Shui CreditAttribution: Feng-Shui commentedAttached patch alters the default value for the autocomplete widget. Results in the value being retained.
Comment #2
mradcliffeComment #3
mradcliffeThank 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.