Problem/Motivation

Leaflet Geocoder Control autocomplete search input doesn't work (PHP 8.1, Drupal 9.5)

Steps to reproduce

  • Let's consider a Geofield in a content type.
  • Set "Leaftlet Map" as widget.
  • In the widget settings, check "Enable Map Geocoder Control"
  • Check your provider (in my case, it's Photon, and it works well with other fields)
  • Create a node, and try to search an address
  • The autocomplete icon appears, but nothing happens.

Comments

troesler created an issue. See original summary.

troesler’s picture

Issue summary: View changes
itamair’s picture

Status: Active » Needs work

It seems this is not working anymore with Drupal core 9.5. Some regression ... Inspecting now.

itamair’s picture

I am experiencing now a weird behaviour.

On the Drupal Leaflet Demo page:

https://www.geodemocracy.com/drupal_geofield_stack_demo/web/geoplaces-ma...

the Geocode Autocomplete input looks working fine to me, with:
Drupal Core 9.5.2
Leaflet 10.0.6

The weird thing is that it doesn't to the Administrator user, though having given the "Access Geocoder Api Url Enpoints" permission (needed) to the authenticator user ...

This is something that needs further investigation.

sanderjp’s picture

I just ran into a similar issue where the address search is working for anonymous but not for logged in users. Can you test if the attached patch fixes the issue? I've removed setting the form-autocomplete class on the search input. It fixes my issue but I'm not sure yet if this change has any other effects, a quick search seemed it was only used for some styling.

itamair’s picture

StatusFileSize
new3.81 KB

thanks @SanderJP ... but nope, your patch would remove the throbber circle in the input autocomplete element.
Though it pointed me to the proper and more solid fix that I attach here as a patch.
PS: also please comply with proper naming convention when providing your patches in drupal.org (https://www.drupal.org/docs/develop/git/using-git-to-contribute-to-drupa...)

  • itamair committed 9c3a4902 on 10.0.x
    Issue #3335853 by itamair, SanderJP: Leaflet Geocoder Control...
itamair’s picture

Status: Needs work » Fixed

#6 patch properly tested and QAed, was committed into dev and will be part of the incoming 10.7 Leaflet module release.

troesler’s picture

Thanks @SanderJP & @itamair :)

Status: Fixed » Closed (fixed)

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

angel ruiz’s picture

Hello to all,

First of all, thank you for the solution.

I tried to apply the patch for version 2.2.12 of the module on the portal I'm working on (Drupal version 9.5.9 and PHP version 8.0.30) and it failed, so I have generated the patch.

Regards.

thulenb’s picture

Hello,

I am also facing the issue that the autocomplete is working for ananymous users but not for logged-in users (including admin). Just installed 10.2.17 version of this module but still not working.
Does anybody has an idea how I can resolve this problem?