Package php-http/message-factory is abandoned, you should avoid using it. Use psr/http-factory instead.

Created on 15 April 2025, 30 days ago

Problem/Motivation

I receive the message Package php-http/message-factory is abandoned, you should avoid using it. Use psr/http-factory instead. when doing a composer install that includes this module. However, if I don't explicitly include php-http/message-factory in composer require, I receive this error in the logs and geocoding fails:

No php-http message factories found. Note that the php-http message factories are deprecated in favor of the PSR-17 message factories. To use the legacy Guzzle, Diactoros or Slim Framework factories of php-http, install php-http/message and php-http/message-factory and the chosen message implementation.

I am guessing that because geocoder relies on php-http/message, the accompanying factory library must also be installed. Is it possible to remove the reliance on php-http/message? Is there a different way to solve the problem? Drupal core already requires psr/http-factory, so that recommendation in the error message does not help.

Steps to reproduce

Require this module in composer and install the module. Perform a proximity search that invokes geocoding at run time.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

💬 Support request
Status

Active

Version

4.0

Component

Code

Created by

🇺🇸United States john.oltman

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @john.oltman
  • 🇮🇹Italy itamair

    thanks @john.oltman for reporting this ...
    BUT I cannot reproduce any of the issue that you report.

    Let's do it together, and with the new Drupal CMS (Drupal 11 based).

    Please follow the steps on "How to install Drupal CMS using DDEV" as described on this page:
    https://new.drupal.org/docs/drupal-cms/get-started/install-drupal-cms/in...

    At the end of the ddev composer create drupal/cms command you will see that everything is being required without any issue and warning, and geocoder module is part of it ... because a dependency of the drupal/drupal_cms_events recipe.

    But also let's try to specifically require the drupal/geocoder project, applying the following composer commands:

    # remove the geofield stack module (and the geocoder module) along with the drupal/drupal_cms_events recipe
    ddev composer remove drupal/drupal_cms_events recipe

    #then let's specifically require the drupal/geocoder module:
    ddev composer require drupal/geocoder

    and all is being required correctly, to me ... with any of the warnings that you report.
    Isn't it?

    Could you kindly instruct me how to reproduce the warning that you experience and report, in the above (very general) scenario that I provided?
    I need to have evidence that what you report is a general / established uses case ... and not a specific of you.

    Otherwise I would Close this as "Works as Designed".

    Thanks ...

Production build 0.71.5 2024