Problem/Motivation
I noticed that only some address input fields were being filled out when using the browsers autofill feature. I looked at the field in question, which in my case is the Locality field. There was an extra "
being printed, which resulted in an invalid autocomplete value. This is the code taken from /plugins/format/address.inc, note the extra "
in the autocomplete value. Starting at line 103:
$format['locality_block']['locality'] = array(
'#title' => $address_format['locality_label'],
'#required' => in_array('locality', $address_format['required_fields']),
'#access' => in_array('locality', $address_format['used_fields']),
'#size' => 30,
'#maxlength' => 255,
'#prefix' => ' ',
'#attributes' => array(
'class' => array('locality'),
'autocomplete' => '"address-level2',
),
);
This is actually in place in the dependent locality field as well (line 77 of the same file):
$format['locality_block']['dependent_locality'] = array(
'#title' => $address_format['dependent_locality_label'],
'#required' => in_array('dependent_locality', $address_format['required_fields']),
'#access' => in_array('dependent_locality', $address_format['used_fields']),
'#size' => 25,
'#maxlength' => 255,
'#tag' => 'div',
'#attributes' => array(
'class' => array('dependent-locality'),
'autocomplete' => '"address-level3',
),
// Most formats place this field in its own row.
'#suffix' => $clearfix,
);
I just looked at the dev version and it appears to exist in there as well.
Proposed resolution
The patch attached simply removes those two quotes.
User interface changes
The autocomplete functionality will now work for these fields.
Please let me know if there is something else needed to get the patch configured correctly.
Comment | File | Size | Author |
---|---|---|---|
#2 | addressfield-autocomplete-typo-2579129-7.x.patch | 671 bytes | skadu |
Comments
Comment #2
skaduComment #3
bojanz CreditAttribution: bojanz at Centarro commentedCommitted, thank you.
Comment #5
skaduWow. That was fast. Thanks bojanz.
Comment #7
ilericiler CreditAttribution: ilericiler commentedAddressfield_autocomplete / location_taxonomize problem. Could not get help from related module issue pages.
When addressfield_autocomplete module is active, location_taxonomize/location_taxonomize_af module can not parse location as taxonomy terms.
The alternative "addressfield_geocomplete" works normally but, it doesnt support map pinning.
The server is ready to debug and all necessary files are editable. I will be sending the password (Same for Drupal User & Folder Access) if you can help me. Thank you.
http://www.ilankar.com/_help.htm