Autocomplete hasn't been working for me. Has anyone else had an issue? This is what I get now (after a repair to one of the template modifications):
The error above did not appear until I first fixed a template modification--it was not being applied. In the
account_details
template modification, this is
Find:
HTML:
<xf:textboxrow name="profile[location]" value="{$xf.visitor.Profile.location_}"
maxlength="{{ max_length($xf.visitor.Profile, 'location') }}"
label="{{ phrase('location') }}" />
Yet in the
account_details
template, this is the code I am seeing. The
hint=..............
line is added. I do not modify any existing templates except through the template modification system, so I don't know if this is an addition made to the code in recent XF versions or not. (Can anyone else verify if this matches their 2.2.12 version? I have so far checked two 2.2.12 templates and they are the same.)
HTML:
<xf:textboxrow name="profile[location]" value="{$xf.visitor.Profile.location_}"
maxlength="{{ max_length($xf.visitor.Profile, 'location') }}"
hint="{{ $xf.options.registrationSetup.requireLocation ? phrase('required') : '' }}"
label="{{ phrase('location') }}" />
If I change
Find: to the code above, I get a match.
However,
Replace: needs to be modified as well, adding the
id="location"
parameter. Giving us this:
HTML:
<xf:textboxrow name="profile[location]" id="location" value="{$xf.visitor.Profile.location_}"
maxlength="{{ max_length($xf.visitor.Profile, 'location') }}"
hint="{{ $xf.options.registrationSetup.requireLocation ? phrase('required') : '' }}"
label="{{ phrase('location') }}" />
<xf:js>
<xf:include template ="j_acl_location"/>
</xf:js>
This does not, however, fix the addon. I get the Google Maps error I pasted above.
In the console, I get the following error:
I dug through Google's documentation and found this. We are using the Places API.
developers.google.com
This is the code they say will load the Places API:
HTML:
<script async
src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=places&callback=initMap">
</script>
So, in the template modification,
&callback=initMap
is missing. However, initMap needs to be in the JavaScript in this addon, as adding
&callback=initMap
to the src above throws an error in the console:
Code:
{
"message": "initMap is not a function",
"stack": "Error
at _.ue.captureStackTrace (https://maps.googleapis.com/maps/api/js?key=MY_API_KEY&libraries=places&language=en&callback=initMap:273:1891)
at new _.ue (https://maps.googleapis.com/maps/api/js?key=MY_API_KEY&libraries=places&language=en&callback=initMap:94:455)
at _.ve (https://maps.googleapis.com/maps/api/js?key=MY_API_KEY&libraries=places&language=en&callback=initMap:95:98)
at lea (https://maps.googleapis.com/maps/api/js?key=MY_API_KEY&libraries=places&language=en&callback=initMap:226:99)
at https://maps.googleapis.com/maps/api/js?key=MY_API_KEY&libraries=places&language=en&callback=initMap:225:232",
"name": "InvalidValueError"
}
So that's where it's at right now. Searching Google again, this page was no help:
developers.google.com