The latest version of Geocoder has requirement for php-http/guzzle6-adapter of an older version (v1.1.1). However, the only significant change that's in the latest version is a change in the class type. However, the changed classes haven't been extended throughout the library. For better reference, please refer to guzzle6-adapter change log which states the notable change in the upgrade to v2.0.0 is "Client and Promise are both final". Accordingly, it'll be very useful if the package dependency is extended to support latest releases as well.

Due to the absence of extension of the altered class i.e. Client and Promise, the Geocoder module will work error-free with the change introduced in the patch for the issue at hand.

Comments

yonas.legesse created an issue. See original summary.

yonas.legesse’s picture

Status: Active » Needs review
StatusFileSize
new404 bytes

Updated version for dependency to accommodate latest releases.

dpagini’s picture

I would like to see this change go in as well.

itamair’s picture

what about the Review on this? I would be more confident if someone can confirm on this and set this as RTBC ...

hussainweb’s picture

Status: Needs review » Reviewed & tested by the community

Since this is a patch on composer.json, I had to test it in a different way. Here's what I did.

  1. Setup a new Drupal 8.9 site for testing
  2. Added php-http/guzzle6-adapter with dependency set as 2.x-dev as 1.1. This ensures that we can install Geocoder module. Patch doesn't help here as patching happens after composer resolves dependencies. But we get the code from 2.x branch. It's important that we do this before adding geocoder as it gets tricky to update after that (but not impossible).
  3. Install geocoder module as normal and one of the providers: composer require drupal/geocoder drupal/geofield geocoder-php/bing-maps-provider
  4. Added a geofield to one of the content types and a text field to input the address
  5. Double check the file at vendor/php-http/guzzle6-adapter to verify that the requirement for php-http/httplug is ^2.0. This is the actual package which holds the PSR-7 compatible ClientInterface. Also verified vendor/php-http/httplug/src/HttpClient.php for good measure.
  6. Created a test node with a sample address and observed that the geofield was being set with correct lat/long coordinates.

I believe the above test is enough to mark this as RTBC. I should say that I was also involved in determining the dependencies with @yonas.legesse and why our code which needs a PSR-7 compatible client was not accepting the client available to Drupal. From the code differences between 1.1 and 2.0, there shouldn't be any break for geocoder.

hussainweb’s picture

Here are the screenshots just in case:

Output from composer show to verify the latest version of adapter is installed.

Geocoder settings for the geofield

Test node output

itamair’s picture

nice job @hussainweb ... I will make a quick final review and commit this asap ...

  • itamair committed 69c04ec on 8.x-3.x authored by yonas.legesse
    Issue #3160832 by yonas.legesse, hussainweb: Support for v2.0 of php-...
itamair’s picture

Status: Reviewed & tested by the community » Fixed
hussainweb’s picture

Yay! Thanks for committing this and also tagging a release.

dpagini’s picture

Yep, thanks all for getting this in! I had tested the same way, pulled in the 2.0 branch as 1.1 on my local composer. So far so good for me as well, but I was such a new user I wasn't 100% confident I was testing what needed to be looked at. Thanks again!

Status: Fixed » Closed (fixed)

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