It looks like its not possible to install Geocoder 2.x with Drupal 9.
Geocoder 2.x depends on egeloen/http-adapter without an explicit dependency (It should since GeocoderHttpAdapter uses it)
egeloen/http-adapter doesnt seem to work with Drupal 9, because Drupal 9 uses laminas/laminas-diactoros instead of zendframework/zend-diactoros. You can see errors when trying to do composer require egeloen/http-adapter
When you attempt to use drupal/geocoder:2.13.0, the exact version willdurand/geocoder:3.3.1 will be used despite it not being the latest. 3.3.1 is used because it doesnt use egeloen/http-adapter.
Some options:
- Declare Geocoder 2 incompatible with Drupal 9
- Geocoder 2 needs to be updated to rely on
willdurand/geocoder:^4 only for Drupal 9.
- Rely on the 3.3.1 quirk which relies on
php-http/httplug instead of egeloen/http-adapter
Comments
Comment #2
dpiPatch is for option 3, replacing
egeloen/http-adapterwithphp-http/httplug.Comment #3
itamair commentedComment #5
itamair commentedSorry ... but I tested and reviewed your patch and it breaks some of the original Geocoder 2.x functional logic: though Geocoding successfully this $geo_collection (https://git.drupalcode.org/project/geocoder/-/blob/8.x-2.x/modules/geoco...) is always undefined, triggering the Display and Log of Failure Message.
I don't have now time to better debug and fix this.
Going to fallback on you suggested Option 1: Declare Geocoder 2 incompatible with Drupal 9 ...
Let me know if you find a very solid and well tested solution to fix the above, so to make Geocoder 2 back for D9.
Comment #8
itamair commentedComment #9
itamair commentedMy fault before (I made some mess with my review ....). Set back Geocoder 2.x compatible with Drupal 9 thanks to this issue contribution ...
Comment #12
itamair commentedNo way. Set Geocoder 2.x incompatible with Drupal 9.
We cannot downgrade to a previous dependency library to upgrade the Geocoder 2.x branch
(lack of Geocoder Provider Openstreetmap in willdurand/geocoder:3.3.1 library)
Comment #13
dpiThanks @itamair, unfortunate situation.
Do you mind adding a notice on the project page under "Geocoder 2.x (Drupal 8)" heading that this version is not compatible with D9.
Further, some of the headings under Geocoder 2.x still mention "D8/D9", the D9 part should be removed.
Thanks!