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.
Can't submit locations when country changes from the default setting on the node. Autocomplete does not update with the new provinces, causing a form validation error.
Comments
Comment #1
John Carbone CreditAttribution: John Carbone commentedOK, I was able to pin this down. It's actually an issue with the "Admin" theme (aka Slate). Broken Javascript within the theme prevents the Location module's autocomplete.js from firing. You can still use Slate with Location but you'll have to set the administration theme to use the site default when editing nodes.
Comment #2
sreynen CreditAttribution: sreynen commentedI had this same problem in a content profile location, and turning off admin module completely didn't fix it, nor did turning off all JS on my theme. I "fixed" it by adding a change() handler for countries to my theme's JS that replicates some of location_autocomplete.js.
Comment #3
YesCT CreditAttribution: YesCT commentedPlease post the code you used to fix this.
Comment #4
sreynen CreditAttribution: sreynen commentedThis is the code I used in my theme's Drupal.behavior function to get it working:
As I said, it's duplicate code from Drupal.behaviors.location, so it could use some refactoring if this looks like a good solution.
Comment #5
YesCT CreditAttribution: YesCT commentedtagging. as the code in #4 might help others fix this problem, but is not in it's current form a fix ready for commit...
Comment #6
docwilmot CreditAttribution: docwilmot commentedhello
have location cck in a content profile node and have the same problem. #4 almost works, except if you select one country, then change to another and another, afterwards if for example you type 'p' and each of the countries you've previously tried has a county starting with 'p' you get 3 simultaneous dropdowns listing counties starting with 'p'. firebug shows a div id="autocomplete" for each country.
is there a problem with locations in content profiles? would be grateful for a fix either way.
thanks
Comment #7
docwilmot CreditAttribution: docwilmot commentedseems this works:
but still curious why this is necessary at all.
Comment #8
jphelan CreditAttribution: jphelan commentedSame issue. For me it was lines 8 and 25 and/or 30 of location_autocomplete.js. The admin theme I'm using replaces the fieldsets with collapsible divs in the template.php file. Changing the fieldset:first to the themes class for the wrapper div fixed it for me.
Comment #9
legolasboClosing old D6 issues as D6 is end of life