Geocoder Submodules Preventing Installed Providers from Displaying (e.g., Google Maps)

Created on 13 April 2025, 9 days ago

Problem/Motivation

There seems to be an issue when installing the Geocoder module and enabling its submodules, geocoder_address, geocoder_field, and geocoder_geofield. After enabling these submodules, the installed provider (e.g., Google Maps) does not show up correctly in Drupal. The error encountered is:

The "googlemaps" plugin does not exist. Valid plugin IDs for Drupal\geocoder\ProviderPluginManager are: random, file
This issue is caused by the submodule's interference with the Geocoder provider plugin configuration, which prevents the installed provider from being recognized.

For more context, many users have faced this problem, and itโ€™s been discussed on the Drupal.org issue page: Geocoder Issue #3153678 ๐Ÿ› How to add Gecoder 3.x providers Needs review .

Steps to reproduce

Proposed resolution



/**
 * Implements hook_install().
 */
function pathauto_install() {
  // Set the weight to 1.
  module_set_weight('geocoder', 1);
}

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

Active

Version

4.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @boulaffasae
  • Pipeline finished with Success
    9 days ago
    Total: 152s
    #472340
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly itamair

    @boulaffasae thanks for reporting this and providing your MR !64 (and parallel patch)
    but I am not going to approve and merge it for the following reasons:

    1. I ask you to better elaborate about your logical findings in the breaking workflow in the correct enabling / availability of the required geocoder providers and the parallel (or subsequent) enabling of the geocoder submodules (geocoder_address, geocoder_field, and geocoder_geofield): could you properly explain what you mean with "submodule's interference with the Geocoder provider plugin configuration" and how and where it exactly happen?
    Also could you explain what your MR !64 is supposed to accomplish and workaround those interferences?

    2. I further (once again) tested the scenario that you describe (the way I got it ... ) with a fresh install of a Drupal 10 (and 11) instance, and a Geocoder 8.x-4.28 release, and I could find any issue in correctly enabling and using the required Geocoder Providers, also with subsequent (or previous) enabling of those geocoder submodules. You could see a detailed description of of my Test and QA in this comment of mine (in this parent issue): https://www.drupal.org/project/geocoder/issues/3153678#comment-16065922 ๐Ÿ› How to add Gecoder 3.x providers Needs review

    I am incline to Close this as "Works as Designed" asap, but I am still curious to read a further explanation of your problematic use case (those kind of interferences explained) and the solving logics of your proposed MR !64 ...

  • Hi @itamair, Yes I'm happy to share the steps to reproduce.

    In a fresh Drupal (DDEV) installation (with both geofield and address contrib modules):

    1. Install Geocoder (to prevent further compatibility issues I will force using 4.0 of willdurand/geocoder)

    ddev composer require 'drupal/geocoder:^4.28' willdurand/geocoder:^4.0
    

    2. Enable the Geocoder

    ddev drush en geocoder_geofield geocoder_address

    3. Now, let's install a provider (I will be using Nominatim adapter)

    ddev composer require geocoder-php/nominatim-provider

    4. Now, head over to /admin/config/system/geocoder/geocoder-provider

    Only File - GPX File - GeoJson File - KML File - Random options show up, no Nominatim :/

    -- --

    Why is this happening ??

    -- --

    Solving the issue :

    Run

    ddev drush ev "module_set_weight('geocoder', 1);"

    Then

    ddev drush cr

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly itamair

    thanks for providing all that @boulaffasae ... I am going through it and check asap

Production build 0.71.5 2024