Deprecate PHPMail::request property

Created on 5 July 2023, about 1 year ago

Problem/Motivation

Running drush to send mail I see deprecation in logs because SERVER_SOFTWARE environment variable is not set.

Steps to reproduce

run drush to execute job to send mail and then check logs

Deprecated function: str_contains(): Passing null to parameter #1 ($haystack) of type string is deprecated in Drupal\Core\Mail\Plugin\Mail\PhpMail->mail() (line 114 of /var/www/html/web/core/lib/Drupal/Core/Mail/Plugin/Mail/PhpMail.php)

#0 /var/www/html/web/core/includes/bootstrap.inc(164): _drupal_error_handler_real()
#1 [internal function]: _drupal_error_handler()
#2 /var/www/html/web/core/lib/Drupal/Core/Mail/Plugin/Mail/PhpMail.php(114): str_contains()
#3 /var/www/html/web/core/lib/Drupal/Core/Mail/MailManager.php(307): Drupal\Core\Mail\Plugin\Mail\PhpMail->mail()
#4 /var/www/html/web/core/lib/Drupal/Core/Mail/MailManager.php(180): Drupal\Core\Mail\MailManager->doMail()
#5 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(583): Drupal\Core\Mail\MailManager->Drupal\Core\Mail\{closure}()
#6 /var/www/html/web/core/lib/Drupal/Core/Mail/MailManager.php(179): Drupal\Core\Render\Renderer->executeInRenderContext()
#7 /var/www/html/web/core/modules/update/update.fetch.inc(44): Drupal\Core\Mail\MailManager->mail()
#8 /var/www/html/web/core/modules/update/update.module(193): _update_cron_notify()
#9 /var/www/html/web/core/lib/Drupal/Core/Cron.php(335): update_cron()
#10 /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(388): Drupal\Core\Cron->Drupal\Core\{closure}()
#11 /var/www/html/web/core/lib/Drupal/Core/Cron.php(318): Drupal\Core\Extension\ModuleHandler->invokeAllWith()
#12 /var/www/html/web/core/lib/Drupal/Core/Cron.php(159): Drupal\Core\Cron->invokeCronHandlers()
#13 /var/www/html/web/core/lib/Drupal/Core/ProxyClass/Cron.php(75): Drupal\Core\Cron->run()
#14 /var/www/html/web/core/modules/automated_cron/src/EventSubscriber/AutomatedCron.php(65): Drupal\Core\ProxyClass\Cron->run()
#15 [internal function]: Drupal\automated_cron\EventSubscriber\AutomatedCron->onTerminate()
#16 /var/www/html/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func()
#17 /var/www/html/web/vendor/symfony/http-kernel/HttpKernel.php(100): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
#18 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(63): Symfony\Component\HttpKernel\HttpKernel->terminate()
#19 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(688): Drupal\Core\StackMiddleware\StackedHttpKernel->terminate()
#20 /var/www/html/web/vendor/drush/drush/src/Boot/DrupalBoot8.php(331): Drupal\Core\DrupalKernel->terminate()
#21 [internal function]: Drush\Boot\DrupalBoot8->terminate()
#22 {main}

Proposed resolution

The check should detect Windows, so better to replace it with PHP_OS which is used for such places in core

Remaining tasks

patch, review, commit

User interface changes

no

API changes

no

Data model changes

no

Release notes snippet

📌 Task
Status

Postponed

Version

11.0 🔥

Component
Mail 

Last updated 21 days ago

No maintainer
Created by

🇫🇷France andypost

Live updates comments and jobs are added and updated live.
  • PHP 8.0

    The issue particularly affects sites running on PHP version 8.0.0 or later.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024