Problem/Motivation and Steps to reproduce
After installing Geocoder (together with geofield) on a fresh Drupal 9, I ran composer require geocoder-php/google-maps-provider in porder to have Google maps support.
When I go to /admin/config/system/geocoder/geocoder-provider I don't see this provider.
The status report shows the error message: The Geocoder provider entity type needs to be installed
Updating the DB doesn't show any pending updates.
From composer.lock:
"require-dev": {
"drupal/address": "*",
"drupal/coder": "^8.2",
"drupal/geocoder_field": "*",
"drupal/geofield": "*",
"geocoder-php/arcgis-online-provider": "^4.0",
"geocoder-php/bing-maps-provider": "^4.0",
"geocoder-php/free-geoip-provider": "^4.1",
"geocoder-php/geo-plugin-provider": "^4.0",
"geocoder-php/geoips-provider": "^4.1",
"geocoder-php/geonames-provider": "^4.1",
"geocoder-php/google-maps-provider": "^4.2",
"geocoder-php/graphhopper-provider": "^0.1.0",
"geocoder-php/host-ip-provider": "^4.0",
"geocoder-php/ip-info-db-provider": "^4.0",
"geocoder-php/mapbox-provider": "^0.1",
"geocoder-php/mapquest-provider": "^4.0",
"geocoder-php/maxmind-provider": "^4.1",
"geocoder-php/nominatim-provider": "^5.0",
"geocoder-php/open-cage-provider": "^4.0",
"geocoder-php/openrouteservice-provider": "^1.0",
"geocoder-php/pelias-provider": "^1.1",
"geocoder-php/photon-provider": "^0.1.0",
"geocoder-php/tomtom-provider": "^4.0",
"geocoder-php/yandex-provider": "^4.0",
"phpro/grumphp": "^0.12.1",
"phpunit/phpunit": "^5.7|^6.5",
"sensiolabs/security-checker": "^4.1",
"squizlabs/php_codesniffer": "^2.7"
},
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | geocoder_geofield_3206916_#5.patch | 2.25 KB | itamair |
Comments
Comment #2
itamair commentedThanks for reporting this @z.stolar.
With my following setup:
Drupal version : 9.0.11
PHP version : 7.4
I cannot reproduce this issue ...
Which exact versions of Drupal and PHP are you using?
Please make sure to have read and followed the readme.md installations instructions fro requiring geocoder providers ... (and be sure to have cleared the cache after doing that).
Please also refer to Geocoder 3.x parent issues where this kind of issue(s) have already been discussed (and solved), such this one: https://www.drupal.org/project/geocoder/issues/3153678
Comment #3
z.stolar commentedThank you @itamair .
This is definitely a duplicate of #3153678: How to add Gecoder 3.x | 4.x providers . I looked for existing issues, but obviously not good enough.
FWIW, I uninstalled Geocoder module(s) and re-enabled them, and now I have my google maps under Providers.
Why wasn't it there before? I still can't tell. It's definitely not a cache-clear issue since I did that several times.
Comment #4
z.stolar commentedAgain, fwiw, I managed to recreate the issue with empiric results:
- initial state:
drush en -y geocoder, geocoder_field, geocoder_geofield- I then added providers (e.g. google maps, OSM). e.g.:
composer require geocoder-php/nominatim-provider- The providers don't appear on the dropdown
- I uninstalled
geocoder_geofield(left other two in place)- Now I see the new providers in the dropdown
- I enabled
geocoder_geofieldagain- Now I don't see the new providers in the dropdown
- I repeated this several times without clearing cache in between - the result is always the same: when
geocoder_geofieldis active, the dropdown shows misleading information.It's important to note that the OSM provider remained in the Active Providers even when it was absent from the dropdown. It feels as if the fact that
geocoder_geofieldis enabled forces the dropdown to show the default list instead of the actual installed providers. Just a guess...Comment #5
itamair commentedThanks @z.stolar for this further investigation.
Now I am convincing myself that the Geocoder_geofield submodule indeed introduces some issue in some circumstances with these providers, because this is not the only post pointing at it for this, though I cannot really reproduce this issues.
The Geocoder_geofield submodule doesn't really do anything with the Geocoder Providers, but adding its default "geojson", "GPXFile" and "KMLFile".
It also defined a ProviderUsingGeometryHandler abstract class not really called/referenced by any ...
May you try if the attached patch fixes your documented issues, @z.stolar?
(otherwise I think I will need to investigate and try for a deeper solution/fix).
Please test & review the attached patch ...
Comment #6
z.stolar commented@itamair - success! :-)
I can now see a unified list of the default set plus the providers I added myself.
Comment #7
itamair commentedNice!. Patch #5 committed into dev and 8.x-3.19 new release deployed with it ...
Comment #10
dianacastillo commentedwhen i uninstalled and then reinstalled the geocoder_geofield module this issue was fixed.
Comment #11
dudeweb commentedGod bless Diana! https://www.drupal.org/project/geocoder/issues/3206916#comment-15631765 works!
Comment #12
dudeweb commentedAH! no. It is in the list but not selectable... and nominatim never appears. Very frustrating. Using D11.