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:

  1. Declare Geocoder 2 incompatible with Drupal 9
  2. Geocoder 2 needs to be updated to rely on willdurand/geocoder:^4 only for Drupal 9.
  3. Rely on the 3.3.1 quirk which relies on php-http/httplug instead of egeloen/http-adapter
CommentFileSizeAuthor
#2 3145136-httplug.patch4.54 KBdpi

Comments

dpi created an issue. See original summary.

dpi’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new4.54 KB

Patch is for option 3, replacing egeloen/http-adapter with php-http/httplug.

itamair’s picture

Title: Geocoder 2.x incompatible with Drupal 9 » Geocoder 2.x need willdurand/geocoder:3.3.1 to be compatible with Drupal 9

  • itamair committed 2f6362c on 8.x-2.x
    Issue #3145136 by dpi: Geocoder 2.x need willdurand/geocoder:3.3.1 to be...
  • itamair committed 5e6afe0 on 8.x-2.x authored by dpi
    Issue #3145136 by dpi: Geocoder 2.x need willdurand/geocoder:3.3.1 to be...
itamair’s picture

Status: Needs review » Needs work

Sorry ... 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.

  • itamair committed 3301054 on 8.x-2.x
    Set Geocoder 2.x incompatible with Drupal 9, due to Issue #3145136 (also...
  • itamair committed a013941 on 8.x-2.x
    Revert "Issue #3145136 by dpi: Geocoder 2.x need willdurand/geocoder:3.3...

  • itamair committed e68d149 on 8.x-2.x
    Set Geocoder 2.x compatible with Drupal 9 (Issue #3145136 & #3145549)
    
  • itamair committed eee9a83 on 8.x-2.x
    Revert "Issue #3145136 by dpi: Geocoder 2.x need willdurand/geocoder:3.3...
itamair’s picture

Status: Needs work » Fixed
itamair’s picture

My fault before (I made some mess with my review ....). Set back Geocoder 2.x compatible with Drupal 9 thanks to this issue contribution ...

  • itamair committed 06cafe0 on 8.x-2.x
    reaplied patch 3145136-httplug.patch (Issue #3145136 by dpi, itamair:...

itamair’s picture

No 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)

dpi’s picture

Thanks @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!

Status: Fixed » Closed (fixed)

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