Looks like a regression from #3008528: Convert providers from simple config to a config entity - I have been using 3.x for quite some time and upgraded today, which includes the post_update hook for migrating the config to entities.

I have the google maps provider installed via composer, which reveals both the Google Maps and Google Maps Business providers, even though we only use the former.

I originally received an exception on constructing the plugin for the business provider:

TypeError: Argument 7 passed to Drupal\geocoder\Plugin\Geocoder\Provider\GoogleMapsBusiness::__construct() must implement interface Http\Client\HttpClient, instance of Drupal\Core\Config\TypedConfigManager given, called in /var/www/html/web/modules/contrib/geocoder/src/ConfigurableProviderUsingHandlerWithAdapterBase.php on line 78 in Drupal\geocoder\Plugin\Geocoder\Provider\GoogleMapsBusiness->__construct() (line 51 of /var/www/html/web/modules/contrib/geocoder/src/Plugin/Geocoder/Provider/GoogleMapsBusiness.php). #0 /var/www/html/web/modules/contrib/geocoder/src/ConfigurableProviderUsingHandlerWithAdapterBase.php(78): Drupal\geocoder\Plugin\Geocoder\Provider\GoogleMapsBusiness->__construct(Array, 'googlemaps_busi...', Array, Object(Drupal\Core\Config\ConfigFactory), Object(Drupal\Core\Cache\DatabaseBackend), Object(Drupal\language\ConfigurableLanguageManager), Object(Drupal\Core\Config\TypedConfigManager), Object(Http\Adapter\Guzzle6\Client))

On inspection, it appears the constructor for the business plugin was not updated to match recent changes. However even after updating the parameters and the corresponding parent constructor call, there's still an exception thrown regarding the requirement to call \Geocoder\Provider\GoogleMaps\GoogleMaps::business() directly.

The attached patch avoids calling the parent at all, since you just get an exception anyway, and updates the post_update hook to try/catch the config entity creation to at least allow the function to complete. I think this still means the business provider isn't migrated, though, since its save process involves instantiating the plugin.

On a related note, 3.x deserves a release?

Comments

bradjones1 created an issue. See original summary.

itamair’s picture

StatusFileSize
new2.61 KB

thanks @bradjones1 for picking this.
The attached patch should have fixed all this, and perform the opportune Google Map Business provider migration and instantiation.
May you test and review it?

Did you also test this 8.x-3.x-dev branch (quite) extensively?
Do you think that it is worth an 8.x-3.0-alpha1 release?
I did it a while ... but I am waiting on subscribers for that (well at least one besides me ;-) )

bradjones1’s picture

Thank you. I will test this for sure. We don't actually use the business integration however ran into this issue for the reasons stated above.

Regarding a release, I say be bold and publish it as an alpha. I have been using 3.x successfully on a site for a year at least. While our implementation is rather simple, I think this branch deserves recognition on the project page, which would in turn drive usage, which would help make it worthy of a stable release.

Thanks for all your work on it!

  • itamair committed d4eda4e on 8.x-3.x
    Issue #3060535 by bradjones1, itamair: GoogleMapsBusiness plugin breaks...
itamair’s picture

Done! 8.x-3.0-alpha1 version just deployed, with this enhancements into it ...

itamair’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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