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.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | test 3 | test 2020-07-27 12-31-36.png | 2.97 KB | hussainweb |
| #6 | Geo settings for Article | test 2020-07-27 12-31-23.png | 120.27 KB | hussainweb |
| #6 | composer.png | 116.8 KB | hussainweb |
| #2 | support_for_v2.0_of_php_http_guzzle6_adapter-3160832-2.patch | 404 bytes | yonas.legesse |
Comments
Comment #2
yonas.legesse commentedUpdated version for dependency to accommodate latest releases.
Comment #3
dpagini commentedI would like to see this change go in as well.
Comment #4
itamair commentedwhat about the Review on this? I would be more confident if someone can confirm on this and set this as RTBC ...
Comment #5
hussainwebSince this is a patch on composer.json, I had to test it in a different way. Here's what I did.
php-http/guzzle6-adapterwith dependency set as2.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).composer require drupal/geocoder drupal/geofield geocoder-php/bing-maps-providervendor/php-http/guzzle6-adapterto verify that the requirement forphp-http/httplugis^2.0. This is the actual package which holds the PSR-7 compatibleClientInterface. Also verifiedvendor/php-http/httplug/src/HttpClient.phpfor good measure.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.
Comment #6
hussainwebHere 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
Comment #7
itamair commentednice job @hussainweb ... I will make a quick final review and commit this asap ...
Comment #9
itamair commentedComment #10
hussainwebYay! Thanks for committing this and also tagging a release.
Comment #11
dpagini commentedYep, 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!