Make MailManager::doMail protected

Created on 21 January 2017, over 7 years ago
Updated 16 February 2023, over 1 year ago

\Drupal\Core\Mail\MailManager::doMail should be protected since it does not implement any interface, and its main entry point is supposed to be \Drupal\Core\Mail\MailManager::mail.

Method introduced in #2663270: MailManager::mail() should run inside its own render context: it sends e-mails, not (cacheable) responses β†’

πŸ“Œ Task
Status

Needs work

Version

9.5

Component
MailΒ  β†’

Last updated 21 days ago

No maintainer
Created by

πŸ‡¦πŸ‡ΊAustralia dpi Perth, Australia

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

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.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request β†’ as a guide.

    This could use an issue summary update as it was suggested this method be deprecated.

  • Status changed to Needs review over 1 year ago
  • πŸ‡¨πŸ‡³China jungle Chongqing, China
       public function doMail($module, $key, $to, $langcode, $params = [], $reply = NULL, $send = TRUE) {
    +    $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2);
    +    if ($backtrace[1]['class'] != 'Drupal\Core\Mail\MailManager') {
    +      @trigger_error('Calling' . __METHOD__ . '() directly is deprecated in Drupal 10.1.0 and it will be marked as protected in Drupal 11.0.0. See https://www.drupal.org/node/NID', E_USER_DEPRECATED);
    +    }
    

    Deprecate it like the above?

  • Status changed to Needs work over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Not sure if it needs to be wrapped in anything. If we are deprecating the whole method it could brought be the first line of the method. Would need a test case also.

  • πŸ‡¨πŸ‡³China jungle Chongqing, China

    #23 is deprecating the public access to make it protect later which is the scope as the title.

Production build 0.71.5 2024