Reviewed & tested by the community
Project:
Geocoder
Version:
8.x-4.0
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
1 Jun 2022 at 15:57 UTC
Updated:
28 Jan 2024 at 23:00 UTC
Jump to comment: Most recent
Comments
Comment #3
claudiu.cristeaComment #4
claudiu.cristeaComment #5
claudiu.cristeaNo idea how to trigger testing
Comment #6
itamair commentedThanks @claudiu.cristea for pointing this out ...
Actually the php-http/guzzle6-adapter is being used by the geocoder.http_adapter, used for Geocoder operations behind Proxy (see Readme.md file) and basically in that case for adding arguments in the ProviderUsingHandlerWithAdapterBase here: https://git.drupalcode.org/project/geocoder/-/blob/8.x-3.x/src/ProviderU...
Changing the requirement into:
"guzzlehttp/guzzle": "^6.5.2 || ^7.4.1",Comment #7
itamair commentedComment #9
itamair commentedComment #10
itamair commentedRolled back because causing https://www.drupal.org/project/geocoder/issues/3284165 ...
Comment #11
itamair commentedThis cannot be accomplished at the moment, as every geocoder-php providers now depends by an HTTP Adapter able to implement Psr\Http\Client\ClientInterface ... and at the moment php-http/guzzle6-adapter is the only one (until Drupal 9.3)
Comment #12
weseze commentedI would like to reopen this, since the version constraint for "guzzlehttp/guzzle" on the 6.x branch is a blocker for all (our) future updates: PHP8.1, D9.4 (soft blocker since it still allows guzzle 6), Drupal 10 (will require PHP8.1 and thus guzzle will need to be 7.x)
Simply locking guzzle to the 6.x branch, which is becoming outdated fast, is not a long term fix for this issue...
Perhaps we could consider a new version that requires Drupal core 9.4 and guzzle 7.x? That version could contain the necessary fixes for the HTTP adapter.
I do also believe this is actual bug, since composer requiring drupal/geocoder after an initial composer install will error out with version constraint issues.
Guzzle 7.x will be locked down through composer on the initial "composer install".
If you then run "composer require drupal/geocoder" it will give errors because composer will not downgrade by default.
This can be worked around by running "composer require drupal/geocoder --with-dependencies" which will downgrade.
But anyone starting fresh from Drupal 9.4 won't be able to composer require this module...
Comment #13
super_romeo commentedTo fix it replace
Guzzle6toGuzzle7:Comment #14
itamair commentedComment #15
itamair commentedof course the provided solution in 3283651-guzzle6-adapter is not a good one at the moment as it breaks all the Geocoding functionalities ... as reported by @super_romeo
Comment #16
itamair commentedI have deployed a new (for testing / experimental) geocoder 8.x-4.0 release that could be required with the following command:
$ composer require 'drupal/geocoder:^4.0'and that relies on the following updated dependency:
"php-http/guzzle7-adapter": "^1.1.0",I was able to make it correctly required into my Drupal 9.4 project accomplishing the following conditions:
- removed
drupal/console(that requires drupal/console-core that requires guzzlehttp/guzzle ~6.1)- removed
drupal/core-recommended(that still requires guzzlehttp/guzzle ~6.1)I have marked this 8.x-4.0 release with the following:
core_version_requirement: ^9 || ^10
but important to mention that this (very probably) cannot still work with Drupal 10 (that requires PHP >= 8.1)
and some of its php geocoders, that still require only php ^7.0, such the followings:
Please Test and Review this 8.x-4.0 Geocoder release and let me know if everything works fine and your follow-ups and further suggestions:
should we make this a parallel supported version, when, and why ...
Comment #17
super_romeo commentedHello @itamair!
Yesterday I could install only Guzzle 7 (because of composer conflicts).
But now I made
composer updateand all downgraded to Guzzle 6.So problem disappeared.
I think something was changed in another packages.
Comment #18
itamair commentedNot really sure I get what you mean/meant @super_romeo ... but I am glad if you solved your issues on this.
Comment #19
weseze commentedI'm still having a lot of issues trying to get this properly installed on D9.4...
I'm not familiar with the inner workings of this module and it seems a bit much to get into right now. But I can provide e detailed list of the steps I did. Hopefully this can give some insights to get this resolved.
First of, the 4.x branch isn't working at all...
Consider this composer.json file:
Run composer install on it, everything is working fine.
Now I want to add drupal/geocoder, so I run composer require drupal/geocoder and I get error:
If I try the 3.x branch it works. (composer require drupal/geocoder:^3.0)
However if I then require the Google Maps geocoder (as per the readme instructions): composer require geocoder-php/google-maps-provider
It fails again...:
I tried running "composer require geocoder-php/google-maps-provider --with-dependencies" to allow for downgrades, but that didn't help.
I was finally able to fix it by running "rm composer.lock && composer require geocoder-php/google-maps-provider --with-dependencies"
Not sure what the exact issue is here, but it seems to be a dependency-hell issue... somewhere in the googlemaps provider.
I also assume that there is no fix to be made here as long as the "geocoder-php/google-maps-provider" does not support guzzle7 and once D9.4 has required version 7, which it does do, there seems to be no easy way to revert other then deleting the composer.lock file.
Comment #20
weseze commentedSo I was finally able to solve this issue by not using:
composer require geocoder-php/google-maps-provider
But using:
composer require geocoder-php/google-maps-provider guzzlehttp/guzzle:^6.0 php-http/guzzle6-adapter:^2.0 --with-dependencies
But this will lock my entire setup to guzzle6, which will give issues eventually when updating to a version of Drupal which will require guzzle7...
Comment #21
itamair commented@weseze ... of course the
composer require 'drupal/geocoder:^3.0'will work and should work as it is the actual supported version for Drupal 8.x and 9.x (used by thousands of websites)... as long as you don't have conflicts or un-compatibilities in your composer requirements.
For the
composer require 'drupal/geocoder:^4.0'it is much more complicate, because still many dependencies are using only the guzzlehttp/guzzle version 6.x
so to make it correctly included in your project you have to remove all those incompatibilities and it will work, as I have been able to make it working on my Drupal 9.4 ... (mentioned that in my case I had to completely remove
drupal/consoleanddrupal/core-recommendedBut may be your case is even more complicated ... I don't know. I assume you already removed all your geocoder-php dependencies (some of them cannot work with guzzlehttp/guzzle version 7.x still, and for sure).
The 'drupal/geocoder:^4.0' won't be easily adoptable until other dependencies won't update their owns and upgrade to guzzlehttp/guzzle version7.x
I am confident that it will be done by the arrival of Drupal 10 ... and we cannot do differently.
Comment #22
schoenef commentedI could manage in a drupal 9.4 project like this:
drupal/core-recommendedtodrupal/corecomposer updatedrupal/core-composer-scaffoldanddrupal/core-project-message- I also raised theire verison number to 9.4 and had to removedrupal/geocoderin the processcomposer require 'drupal/geocoder:^4.0'I tested and it works fine for my usecase (reverse geocoding from address to geo corrdinates)
It appears to be a strange inbetween time from guzzle 6 to 7... fingers crossed and thx a lot for the work!
Comment #23
claudiu.cristea@itamair, I've required ^4.0 and it's doing the job. Thank you!
However, I see no 4.x (or 8.x-4.x) branch and it would be nice if this new release could appear more prominently on the project's page.
Comment #24
claudiu.cristeaAlso, it looks like 8.x-3.x branch has diverged. We definitely, need a 4.x branch
Comment #25
claudiu.cristeaFound another issue:
There's no version to satisfy this constraint in https://github.com/php-http/guzzle7-adapter/tags. As an effect, on my project , it installs the
masterbranch. I think it should be changed to:Comment #26
itamair commentedThanks @claudiu.cristea ... I guess you are right.
I didn't publish yet a 4.x branch release due the extended dependencies of other packages (and some php geocoders providers themselves) by the php-http/guzzle6-adapter ...
Anyway I just deployed a new 8.x-4.2 release with "php-http/guzzle7-adapter": "^1.0 dependency and with specific Readme.md documentatin page, and also added Geocoder 4.x branch mention and description in the Geocoder Drupal.org page itself (and with reference to this issue thread).
Comment #27
claudiu.cristea@itamair, unfortunately, somehow, in the 4.3.0 release this has been reverted https://git.drupalcode.org/project/geocoder/-/blob/8.x-4.3/composer.json... Looks to me as if 4.3.0 hasn't been tagged from the 8.x-4.x branch. Could you, please, align them?
Comment #28
itamair commented@claudiu.cristea not sure I get that.
Now once I run the following:
composer require 'drupal/geocoder:^4.3'I get the geocoder 4.3 release exactly with this: https://git.drupalcode.org/project/geocoder/-/blob/8.x-4.x/composer.json...
What am I missing?
Comment #29
claudiu.cristeaCould you check the installed version?
composer info drupal/geocoder? Is it 4.3.0? Because I had^4.0as constraint and I got this https://git.drupalcode.org/project/geocoder/-/blob/8.x-4.3/composer.json (which is the 4.3.0 stable version according to GitLab repo)EDIT: Look at the URL that you've posted in the last comment. It's the branch (8.x-4.x), not the stable (8.x-4.3)
Comment #30
itamair commentedOk I got it. Sorry my bad, as taking care of many Geofield stack modules updates these days.
New 8.x-4.4 release deployed with everything realigned ...
Thanks, great catch.
Comment #31
w01f commentedI'm getting the following error still when trying to update geocoder to a more recent release (I just tried 4.4). Am I missing an additional step or something in my config causing this?
Comment #32
dan_metille commentedI'm getting same kind of error as above:
Comment #33
adaragao commentedI'm having the same problem as the two previous comments, maybe this can help:
Comment #34
claudiu.cristea@adaragao See https://www.drupal.org/project/drupal/issues/3225966
I think your issue is that drupal/core-recommended still requires Guzzle 6. You should replace drupal/core-recommended with drupal/core
Also drupal/console-core needs a version that allows guzzle 7 too: https://github.com/hechoendrupal/drupal-console-core/issues/387
Comment #35
claudiu.cristeaI think this is done and should be closed
Comment #36
karimbou commentedSo you're saying we need to use drupal/console-core instead of drupal/console ?
Using D9.4.8 PHP8.1 here's the result for me :
Comment #37
w01f commentedSorry, probably a newb question - but what is the difference between core-recommended and core? I think I remember switching the other way a few years ago when I had to composerify all of my sites? Is "core" the official version now that will be best to use when upgrading to D10? Is there any documentation comparing these two? Thanks in advance!
Comment #38
nick hope commentedI'm also prevented from installing the Geocoder 4.X branch because I have
drupal/core-recommended: "^9.4"in my composer.json file, which requires guzzle ~6.5.8 (my site was based on the drupal-project template which specifies drupal/core-recommended).@W01F You can see the drupal/core-recommended README file for an explanation, and there is also a discussion on Drupal Answers. Personally I think I prefer to stay with drupal/core-recommended rather than drupal/core, so I will stay with Geocoder 3.X for now and revisit this when I upgrade to D10.
Comment #39
claudiu.cristea@W01F
drupal/core-recommendedis just a wrapper arounddrupal/corewhich limits the constraints of core dependencies to those that were tested in Drupal CI. It doesn't allow a dependency to update to a higher version than the one already tested in the Drupal.org testing pipeline.drupal/core-recommendedlimits Guzzle to 6. But D10 & PHP 8.1 need Guzzle 7. If you want to update, you'll need to switch fromdrupal/core-recommendedtodrupal/coreto unleash Guzzle 7Comment #40
loopy1492 commentedDefinitely cannot upgrade this package to 4.x on a site using drupal/core-recommended 9.x and removing core-recommended causes a cascade of dependency issues which are just a nightmare to resolve.
I probably won't upgrade to 4.x until we go to Drupal 10 itself.
Comment #41
willids commentedSame problem. on Drupal core 9.5.3
Problem 1
- php-http/guzzle7-adapter 1.0.0 requires guzzlehttp/guzzle ^7.0 -> found guzzlehttp/guzzle[7.0.0, ..., 7.5.0] but the package is fixed to 6.5.8 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
- drupal/geocoder 4.4.0 requires php-http/guzzle7-adapter ^1.0 -> satisfiable by php-http/guzzle7-adapter[1.0.0].
- Root composer.json requires drupal/geocoder ^4.4 -> satisfiable by drupal/geocoder[4.4.0].
Once installed unable to update the structure of items as it stops updating this running correctly- composer require geocoder-php/google-maps-provider
Comment #42
piotr pakulskiSame problem with
drupal/core-recommendedlooks like waiting for D10 is the only option if I do not want to strip out recommended?Comment #45
willids commentedGetting this error, not able to edit any content types because of this.
Drupal 9.5.8
PHP 8.1
Geocoder 8.x-49
================
[27-Apr-2023 10:26:05 Europe/London] Error: Class "Http\Adapter\Guzzle7\Client" not found in /home/DOMAINNAME/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 #0 /home/DOMAINNAME/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService(Array, 'geocoder.http_a...')
#1 /home/DOMAINNAME/public_html/modules/geocoder/src/ConfigurableProviderUsingHandlerWithAdapterBase.php(88): Drupal\Component\DependencyInjection\Container->get('geocoder.http_a...')
#2 /home/DOMAINNAME/public_html/core/lib/Drupal/Core/Plugin/Factory/ContainerFactory.php(21): Drupal\geocoder\ConfigurableProviderUsingHandlerWithAdapterBase::create(Object(Drupal\Core\DependencyInjection\Container), Array, 'googlemaps', Array)
#3 /home/DOMAINNAME/public_html/core/lib/Drupal/Component/Plugin/PluginManagerBase.php(83): Drupal\Core\Plugin\Factory\ContainerFactory->createInstance('googlemaps', Array)
#4 /home/DOMAINNAME/public_html/core/lib/Drupal/Core/Plugin/DefaultSingleLazyPluginCollection.php(62): Drupal\Component\Plugin\PluginManagerBase->createInstance('googlemaps', Array)
#5 /home/DOMAINNAME/public_html/core/lib/Drupal/Component/Plugin/LazyPluginCollection.php(80): Drupal\Core\Plugin\DefaultSingleLazyPluginCollection->initializePlugin('googlemaps')
#6 /home/afvbcouk/public_html/modules/geocoder/src/Plugin/GeocoderProviderPluginCollection.php(22): Drupal\Component\Plugin\LazyPluginCollection->get('googlemaps')
#7 /home/afvbcouk/public_html/core/lib/Drupal/Core/Plugin/DefaultSingleLazyPluginCollection.php(83): Drupal\geocoder\Plugin\GeocoderProviderPluginCollection->get('googlemaps')
#8 /home/DOMAINNAME/public_html/core/lib/Drupal/Core/Plugin/DefaultSingleLazyPluginCollection.php(99): Drupal\Core\Plugin\DefaultSingleLazyPluginCollection->setConfiguration(Array)
#9 /home/DOMAINNAME/public_html/core/lib/Drupal/Core/Plugin/DefaultSingleLazyPluginCollection.php(55): Drupal\Core\Plugin\DefaultSingleLazyPluginCollection->addInstanceId('googlemaps', Array)
#10 /home/DOMAINNAME/public_html/modules/geocoder/src/Entity/GeocoderProvider.php(103): Drupal\Core\Plugin\DefaultSingleLazyPluginCollection->__construct(Object(Drupal\geocoder\ProviderPluginManager), 'googlemaps', Array)
#11 /home/DOMAINNAME/public_html/modules/geocoder/src/Entity/GeocoderProvider.php(119): Drupal\geocoder\Entity\GeocoderProvider->getPluginCollection()
#12 /home/afvbcouk/public_html/modules/geocoder/src/Entity/GeocoderProvider.php(144): Drupal\geocoder\Entity\GeocoderProvider->getPlugin()
#13 /home/DOMAINNAME/public_html/modules/geocoder/src/ProviderPluginManager.php(236): Drupal\geocoder\Entity\GeocoderProvider->isConfigurable()
#14 [internal function]: Drupal\geocoder\ProviderPluginManager->Drupal\geocoder\{closure}(Array, 0)
#15 /home/DOMAINNAME/public_html/modules/geocoder/src/ProviderPluginManager.php(238): array_map(Object(Closure), Array, Array)
#16 /home/DOMAINNAME/public_html/modules/geocoder/modules/geocoder_field/src/Plugin/Geocoder/Field/DefaultField.php(320): Drupal\geocoder\ProviderPluginManager->providersPluginsTableList(Array)
#17 /home/afvbcouk/public_html/modules/geocoder/modules/geocoder_field/geocoder_field.module(91): Drupal\geocoder_field\Plugin\Geocoder\Field\DefaultField->getSettingsForm(Object(Drupal\field\Entity\FieldConfig), Array, Object(Drupal\Core\Form\FormState))
#18 /home/DOMAINNAME/public_html/core/lib/Drupal/Core/Extension/ModuleHandler.php(562): geocoder_field_form_field_config_edit_form_alter(Array, Object(Drupal\Core\Form\FormState), 'field_config_ed...')
#19 /home/DOMAINNAME/public_html/core/lib/Drupal/Core/Form/FormBuilder.php(838): Drupal\Core\Extension\ModuleHandler->alter('form', Array, Object(Drupal\Core\Form\FormState), 'field_config_ed...')
#20 /home/DOMAINNAME/public_html/core/lib/Drupal/Core/Form/FormBuilder.php(282): Drupal\Core\Form\FormBuilder->prepareForm('field_config_ed...', Array, Object(Drupal\Core\Form\FormState))
#21 /home/DOMAINNAME/public_html/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\field_ui\Form\FieldConfigEditForm), Object(Drupal\Core\Form\FormState))
#22 [internal function]: Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch))
#23 /home/DOMAINNAME/public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#24 /home/DOMAINNAME/public_html/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#25 /home/afvbcouk/public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#26 /home/DOMAINNAME/public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#27 /home/DOMAINNAME/public_html/vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#28 /home/afvbcouk/public_html/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#29 /home/DOMAINNAME/public_html/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#30 /home/DOMAINNAME/public_html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#31 /home/DOMAINNAME/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#32 /home/DOMAINNAME/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#33 /home/DOMAINNAME/public_html/modules/advban/src/AdvbanMiddleware.php(57): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#34 /home/DOMAINNAME/public_html/core/modules/ban/src/BanMiddleware.php(50): Drupal\advban\AdvbanMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#35 /home/DOMAINNAME/public_html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\ban\BanMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#36 /home/DOMAINNAME/public_html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#37 /home/DOMAINNAME/public_html/modules/remove_http_headers/src/StackMiddleware/RemoveHttpHeadersMiddleware.php(49): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#38 /home/DOMAINNAME/public_html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\remove_http_headers\StackMiddleware\RemoveHttpHeadersMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#39 /home/DOMAINNAME/public_html/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#40 /home/DOMAINNAME/public_html/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#41 {main}
==============
Comment #46
the_g_bomb commentedConfirmed this is still a problem for the recommended module version
Running:
composer require drupal/geocoder
results in:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- php-http/guzzle7-adapter[1.0.0, ..., 1.x-dev] require guzzlehttp/guzzle ^7.0 -> found guzzlehttp/guzzle[7.0.0-beta.1, ..., 7.5.x-dev] but these were not loaded, likely because it conflicts with another require.
- drupal/geocoder[4.9.0, ..., 4.x-dev] require php-http/guzzle7-adapter ^1.0 -> satisfiable by php-http/guzzle7-adapter[1.0.0, 1.x-dev].
- Root composer.json requires drupal/geocoder ^4.9 -> satisfiable by drupal/geocoder[4.9.0, 4.x-dev].
Running:
composer require drupal/geocoder:4.x-dev@dev
results in:
Completed installation
Comment #47
transmitter commentedI seem to be unable to install the dev version successfully.
Same as in the geocoder:^4.9 branch.
Is there an alternative to first upgrade to 10 and then switch Geocoder back on - even though I can't uninstall it, since fields are using it?
I've removed the core-recommended entry from composer.json.
But still:
What to do about the php-http/guzzle6-adapter v2.0.2 requires guzzlehttp/guzzle (^6.0) ?
Comment #48
itamair commentedHey here ... good news here, on my side
I am on al fresh Drupal 10, with
drupal/core-recommendedand I cannot reproduce any specific issues/impediments with the following commands that require Geocoder 8.x-4.x branch now:
also I am able to successfully require the following geocoder providers:
Specifically my configuration is the following:
Drupal version: 10.0.4
PHP: 8.1
Composer version 2.5.4
etc.
It looks to me that Geocoder 8.x-4.x branch can be installed nicely on Drupal 10 now, without major core and accessory libraries incompatibilities.
Do you experience the same successful workflow (also with drupal/core-recommended required) ?
Can we set it as Recommended branch too?
Comment #49
dadderley commentedI have a Drupal 9.5.9 site running in php8.1.13.
When I try to update Geocoder.
I want to upgrade to Drupal 10 and this is a blocker.
Looks like installing geocoder:4.9 on a Drupal 10 site works, but how do I do the upgrade?
Comment #50
grahamshepherd commentedI followed the example of csv_serialization:
"When preparing for an upgrade to Drupal 10 we recommend that you widen your Composer version constraints to allow either 2.x or 3.x: composer require drupal/csv_serialization:^2.0 || ^3.0. This will allow the module to be automatically upgraded when you upgrade Drupal core."
In the case of geocoder I edited composer.json to:
Upgrade status continued to report that geocoder was incompatible.
Nevertheless, I ran:
Followed by:
Database updates proceeded correctly.
Drupal updated to 10.0.9 and geocoder updated to 8.x-4.9.
Success.
I suggest adding a paragraph to the project page:
"When preparing for an upgrade to Drupal 10 we recommend that you widen your composer version constraints to allow either 3.x or 4.x. Edit composer.json to require drupal/geocoder: "^3.0 || ^4.0". This will allow the module to be automatically upgraded when you upgrade Drupal core."
Comment #51
dadderley commentedThank you Graham Shepherd
This simple manual modification of composer.json allowed me to upgrade from 9.5.9 to 10.0.9 and geocoder to be updated from 8.x-3.34 to 10.x-4.9
Comment #52
itamair commentedThanks @GrahamShepherd ...
Your #50 comment looks a great contribution to this thread.
Noted it for soon implementation in the module presentation page and documentation.
Comment #53
transmitter commentedThanks @GrahamShepherd,
worked here as well now.
Comment #54
grahamshepherd commentedThanks for the feedback.
It would seem appropriate that upgrade_status should recognize the broadening of composer.json version requirements where appropriate. There are probably several modules in the geocoder and csv_serialization category where a new version is required for Drupal 10 which is not compatible with Drupal 9.
I wll put in a suggestion to that effect against that module.
Comment #58
itamair commented@GrahamShepherd ... your suggested documentation on how to (more) seamlessly upgrade to Drupal 10 and Geocoder 4.x have been added in the Drupal.org Geocoder main page documentation (so as also on the Geocoder 4.x-dev branch Readme.md file)
Comment #59
grahamshepherd commentedThanks @itamair. I notice that on the project page the link to the issue goes nowhere, ie it need an href="".
"This will allow the module to be automatically upgraded when you upgrade Drupal core.
(For more info refer to this Issue Comment.)"
It's petty, I'm sorry, but for completeness.
I have added this issue to the upgrade status module: https://www.drupal.org/project/upgrade_status/issues/3363765
Comment #60
itamair commentedthanks for the catch @GrahamShepherd ... fixed that link.
Comment #61
hockey2112 commentedcomposer require drupal/geocoder:^3.20 || ^4.0
That worked for me as well. Thanks!
Comment #62
willids commentedTried
composer require drupal/geocoder:^3.20 - not worked
Tried
composer require drupal/geocoder:^4.0 - worked
Cheers
Comment #63
alina.basarabeanu commentedUpgrading from 3 to 4 versions is impossible because of the php-http/guzzle6-adapter requirement.
Can this fix be merged as soon as possible? we really need to move to Drupal 10 and this is the only module blocking us.
Comment #64
itamair commented@Alina Basarabeanu before upgrading from geocoder 3.x to 4.x branch you indeed need to remove php-http/guzzle6-adapter dependency and (before of it) any other module/library/component you do have that is depending from it ...
Once done, you will be able to "composer require 'drupal/geocoder:^4.9'", and require php-http/guzzle7-adapter along with it ...
Comment #65
alina.basarabeanu commentedMerging the pull request for this issue makes the process much easier and faster.
Comment #66
itamair commentedWell ... the MR attached to this was just an initial workaround removing the php-http/guzzle6-adapter dependency.
But it doesn't look a solid and wise solution, because it assumes the php-http/guzzle6-adapter or php-http/guzzle7-adapter should be in parallel required (or already present) somehow.
They are a dependency requirement for this module (3.x or 4.x branches), and this won't work if not already present and not automatically required as dependency.
So we still need to explicitly add as dependency of this module ... (or am I missing something?)
Comment #67
erwangel commentedTyping
composer require drupal/geocoder:^3.20 || ^4.0as per #61 simply installs the geocoder 3 (3.34.0 in my case on Drupal 9.5). Of course geocoder 3 seems to work with Drupal 9.5. But we still need a solution for installing geocoder 4 on Drupal 9 and 10.Comment #68
itamair commentedHey hey! Now the following:
composer require 'drupal/geocoder'will require drupal/geocoder:4.x branch by default, as the 4.x is marked as Recommended branch,
and so in Drupal 9.4+ and Drupal 10
Of course you should get rid from your code base (and composer requirements) of any constrain that prevents it (even your PHP version, that should be 8+).
SO DEFINITELY WE HAVE A CLEAR WAY TO INSTALL Gecoder module (4.x) for Drupal 9.4+ and Drupal 10
This Geofield Live Demo site is indeed a Drupal 10 correctly working with Geocoder 4.x branch (last release).
If you are blocked on this, it depends on your composer code base & requirements / constraints (and may be your lack of capabilities in solving them), and not caused by Geocoder 4.x limitations / incompatibilities ...
Otherwise please arise and document a clear Blocker dependency on this.
Comment #69
joseph.olstadComment #70
robcarrThe blocker if you are trying to prep a site for D9 > D10 upgrade is guzzlehttp/guzzle. Run `composer why guzzlehttp/guzzle` and you can see that drupal/core-recommended (9.5.11) requires guzzlehttp/guzzle (~6.5.8) (whereas drupal/core is more flexible as it requires guzzlehttp/guzzle (^6.5.8 || ^7.4.5)).
Only solution is at #3283651-50: Drupal 10 compatibility: changing php-http/guzzle6-adapter dependency into php-http/guzzle7-adapter (#50) to modify your composer.json file
Comment #71
netgeek123 commentedRan;
Simply changing the composer.json php-http/guzzle6-adapter v2.0.2 requires guzzlehttp/guzzle (^6.0) to requires guzzlehttp/guzzle (^6.5.8 || ^7.4.5) should work?
And change the core recommended?
Comment #72
rolodmonkey commentedSince it has been more than a year since this was marked RTBC, and people are still actively debating the correct solution, I am bumping this back down to "Needs work".
Comment #73
itamair commentedThanks @RoloDMonkey but this doesn't need any work on the Geocoder side, as there is no real issue in adopting Geocoder 8.x-4.x branch (k of adoptions already) and also no real in moving from 8.x-3.x into 8.x-4.x,
but only a correct approach and understanding how each existing composer based project should remove any dependency from php-http/guzzle6-adapter and simply move on ...
Previous comments (#50) simply prove that a smart and feasible upgrade is possible and its advice/suggestion was even added in the project page.
Users simply need to go through this thread to find their way ...
RTBC is the proper state, to keep this still in the Open issues.
Comment #77
alexgreyhead commentedFor anybody who's just arrived at the bottom of this thread and are trying to work out why Geocoder is stopping them preparing their D9 install for D10, please see comment #50 on this page - a few comments upwards :-)
/A