Automated Drupal 10 compatibility fixes

Created on 19 January 2023, almost 2 years ago
Updated 12 July 2023, over 1 year ago

Hello project maintainers,

This is an automated issue to help make this module compatible with Drupal 10.

📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇮🇳India shivam_tiwari

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Assigned to Charchil Khandelwal
  • Status changed to Needs review almost 2 years ago
  • Issue was unassigned.
  • First commit to issue fork.
  • First commit to issue fork.
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.0.7 + Environment: PHP 8.1 & sqlite-3.27
    last update over 1 year ago
    5 pass
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.0.7 + Environment: PHP 8.1 & sqlite-3.27
    last update over 1 year ago
    Composer require failure
  • 🇺🇦Ukraine Matroskeen 🇺🇦 Ukraine, Lutsk

    MRs are weird, so we'll go with the old-fashioned patch way.

  • 🇺🇦Ukraine Matroskeen 🇺🇦 Ukraine, Lutsk

    D10 version is ready to be tested in 2.0.x-dev release. Waiting for confirmation from other people to mark this as "Fixed".

  • Perhaps this is due to how I installed it, but the 2.0x-dev release fails completely for me. Installing over the top of 1.x appears OK, and removes the guzzle6 adapter:

    $ composer require 'drupal/mailgun:2.0.x-dev@dev'
    ./composer.json has been updated
    Running composer update drupal/mailgun
    Loading composer repositories with package information
    Updating dependencies
    Lock file operations: 0 installs, 1 update, 1 removal
      - Removing php-http/guzzle6-adapter (v2.0.2)
      - Upgrading drupal/mailgun (dev-1.x 087590a => dev-2.0.x 6732b06)
    Writing lock file
    Installing dependencies from lock file (including require-dev)
    Package operations: 0 installs, 1 update, 1 removal
      - Syncing drupal/mailgun (dev-2.0.x 6732b06) into cache
      - Removing php-http/guzzle6-adapter (v2.0.2)
      - Upgrading drupal/mailgun (dev-1.x 087590a => dev-2.0.x 6732b06): Checking out 6732b06857 from cache
    <snip>
    

    But then trying to configure via /admin/config/services/mailgun/settings it appears guzzle is still required:

    The website encountered an unexpected error. Please try again later.
    
    Http\Discovery\Exception\NotFoundException: No PSR-18 clients found. Make sure to install a package providing "psr/http-client-implementation". Example: "php-http/guzzle6-adapter". in Http\Discovery\Psr18ClientDiscovery::find() (line 27 of /app/vendor/php-http/discovery/src/Psr18ClientDiscovery.php).
    
    Http\Discovery\ClassDiscovery::findOneByType('Psr\Http\Client\ClientInterface') (Line: 25)
    Http\Discovery\Psr18ClientDiscovery::find() (Line: 130)
    Mailgun\HttpClient\HttpClientConfigurator->getHttpClient() (Line: 82)
    Mailgun\HttpClient\HttpClientConfigurator->createConfiguredClient() (Line: 83)
    Mailgun\Mailgun->__construct(Object) (Line: 99)
    Mailgun\Mailgun::create('myapikey', 'https://api.mailgun.net') (Line: 40)
    Drupal\mailgun\MailgunFactory->create()
    call_user_func_array(Array, Array) (Line: 255)
    Drupal\Component\DependencyInjection\Container->createService(Array, 'mailgun.mailgun_client') (Line: 177)
    Drupal\Component\DependencyInjection\Container->get('mailgun.mailgun_client', 1) (Line: 434)
    Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) (Line: 237)
    Drupal\Component\DependencyInjection\Container->createService(Array, 'mailgun.mail_handler') (Line: 177)
    Drupal\Component\DependencyInjection\Container->get('mailgun.mail_handler') (Line: 39)
    Drupal\mailgun\Form\MailgunAdminSettingsForm::create(Object) (Line: 28)
    Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition('\Drupal\mailgun\Form\MailgunAdminSettingsForm') (Line: 48)
    Drupal\Core\Controller\HtmlFormController->getFormObject(Object, '\Drupal\mailgun\Form\MailgunAdminSettingsForm') (Line: 58)
    Drupal\Core\Controller\FormController->getContentResult(Object, Object)
    call_user_func_array(Array, Array) (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
    Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 169)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
    Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
    Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
    Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
    Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
    Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 718)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
    

    Looking at composer.json I see the comment that guzzle6-adapater is "Required for working with Guzzle 6 e.g. Drupal 9.3.x or earlier", so presumably this should work fine on my 9.5.9 install?

  • 🇺🇦Ukraine Matroskeen 🇺🇦 Ukraine, Lutsk

    @gaddman you should have either Guzzle 7 or Guzzle 6 + guzzle6-adapter.

    If your project requires drupal/core-recommended, you won't be able to upgrade to Guzzle 7 before you upgrade to Drupal 10. In that case, you should manually require guzzle6-adapter.

    Otherwise, you should be able to upgrade to Guzzle 7 while you still have 9.5.9.

    We'll make it clear in the release notes.

  • Thanks @Matroskeen! I'm requiring drupal/core-recommended so reinstalled with guzzle6 manually required, ie composer require 'drupal/mailgun:2.0.x-dev@dev' php-http/guzzle6-adapter.
    Tested the basic capability I use and all working fine: sending email with inline images and attachments + custom headers (from the reroute_email module).

  • Status changed to RTBC over 1 year ago
  • 🇺🇦Ukraine podarok Ukraine

    let's have a release, RTBC because of above comment

  • Status changed to Fixed over 1 year ago
  • 🇺🇦Ukraine Matroskeen 🇺🇦 Ukraine, Lutsk
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024