Drupal 11.3 introduces compatibility with PHP 8.5, in preparation for Drupal 12 requiring PHP 8.5
If I use PHP 8.5 for a site with this module, I get the following errors:
Deprecated function: Mailgun\Mailgun::__construct(): Implicitly marking parameter $hydrator as nullable is deprecated, the explicit nullable type must be used instead in include() (line 576 of {composer-root}/vendor/composer/ClassLoader.php).
Deprecated function: Mailgun\Mailgun::__construct(): Implicitly marking parameter $requestBuilder as nullable is deprecated, the explicit nullable type must be used instead in include() (line 576 of {composer-root}/vendor/composer/ClassLoader.php).
Deprecated function: Mailgun\Api\Domain::create(): Implicitly marking parameter $smtpPass as nullable is deprecated, the explicit nullable type must be used instead in include() (line 576 of {composer-root}/vendor/composer/ClassLoader.php).
Deprecated function: Mailgun\Api\Domain::create(): Implicitly marking parameter $spamAction as nullable is deprecated, the explicit nullable type must be used instead in include() (line 576 of {composer-root}/vendor/composer/ClassLoader.php).
Deprecated function: Mailgun\Api\Domain::create(): Implicitly marking parameter $wildcard as nullable is deprecated, the explicit nullable type must be used instead in include() (line 576 of {composer-root}/vendor/composer/ClassLoader.php).
Deprecated function: Mailgun\Api\Domain::create(): Implicitly marking parameter $forceDkimAuthority as nullable is deprecated, the explicit nullable type must be used instead in include() (line 576 of {composer-root}/vendor/composer/ClassLoader.php).This is fine with PHP 8.4
| Comment | File | Size | Author |
|---|
Issue fork mailgun-3564209
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
jamesoakleyOK, so this is an issue with the mailgun library that is included, not with the code in this module itself
Currently we have this in composer.json
The mailgun/mailgun-php package has 4.3.5 as its most recent release, so I'm guessing PHP 8.5 compatibility was not included in the 3.x branch.
Comment #3
jamesoakleyCorrection, I am now getting those same errors in PHP 8.4. As-is, this module only works with PHP 8.3 latest.
Comment #5
jamesoakleyConfirming that this merge request fixes this problem on my sites. Attached as a patch version
Comment #6
johnpicozziI'm also having this issue after upgrading to php 8.4. The patch above does update the composer requirements as expected. However composer won't install that requirement without use of the lenient package. I suggest merging this patch and cutting a new release.
Comment #7
jamesoakleyJohn, I agree this needs merging and a new release tagging.
If you think the patch addresses the issue, so this is ready to merge, please change the status to RTBC. I can't, because it's my patch, and I don't maintain the module. That will signal to the maintainers that we believe this patch to be ready for merging.
In the meantime, you're right that you can't change a project's composer.json file using composer patches. However, you can switch to using the issue fork.
In the repositories section of your master composer.json file, exclude mailgun from the drupal packages declaration, then add this issue's fork as an additional repository:
Then change the drupal/mailgun entry in the require section, so it now looks like this:
"drupal/mailgun": "dev-3564209-php-8.4-errors as 2.1.x-dev",The easiest way to do that is to use the composer command, so it updates the lock file at the same time:
composer require drupal/mailgun:3564209-php-8.4-errorsHere's hoping we can get a new tagged release soon, so these work-arounds are soon redundant.
Comment #8
johnpicozziComment #9
aaronbaumanRTBC+1
Comment #10
aaronbaumanPosting related / tangential issue here for posterity, and because I don't know where else to post it.
I ran into an incompatibility between this module and simplesamlphp_auth, even with the update to
mailgun-php4 in this thread, because ofmailgun-php's dependency on an old version ofwebmozart/assert.Here's the PR that got things going for me: https://github.com/mailgun/mailgun-php/pull/949
Any my
composer.jsonlooks like this:Comment #11
jamesoakleyAaron, not sure whether it belongs in the issue queue for the mailgun module or the simplesamlphp_auth module, but it sounds like a different issue from this one. I'd suggest creating a new issue just for this. It can then be moved between the issue queues of the two modules, as needed. If you think it relates to this issue, you can always cross-reference the issues to each other using the related issues field.
Comment #12
aaronbaumanYes, good suggestion, and my apologies for derailing this thread.
Opened a new issue here: #3580037: Incompatibility between mailgun module, simplesamlphp_auth module, mailgun php library, and latest version of webmozart/assert
Comment #13
ben.hamelinRTBC+1
Note @jamesoakley - following your composer.json guidelines did not work for me exactly, I had to run (in DDEV of course)
ddev composer require "drupal/mailgun:dev-3564209-php-8.4-errors as 2.1.x-dev" -WAdding the quotes and the -W flag to ensure mailgun update happened as well.
Please let me know if there's anything else I can do to get this tagged as a release, thanks!
Comment #14
fizcs3 commentedNoting older duplicate issue:
Allow mailgun/mailgun-php v4.3 for PHP 8.4 support
Comment #15
usingsession commentedRTBC+1
I created the new pipeline. Tests passed.
Comment #17
bohartThis has been merged into a new 2.2.x-dev (will be a part of a future 2.2.0 release).