Closed (outdated)
Project:
Drupal core
Version:
11.x-dev
Component:
mail system
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
22 Apr 2011 at 06:35 UTC
Updated:
21 Jun 2025 at 18:12 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
pillarsdotnet commentedPatch.
Comment #2
sunVarious coding style issues. See http://drupal.org/coding-standards
It looks like this patch tries to retain support for strings to some extent, but then again not.
For D8, if this patch is going to be considered, a decision needs to be made as to whether both data types are allowed, or whether all variables should be arrays for consistency.
Powered by Dreditor.
Comment #3
pillarsdotnet commented@sun -- I don't understand how indenting two spaces for each added nested parenthesis is a violation of coding standards. Please explain.
And yes, I am trying to maintain backwards compatibility with the existing API, because I have hopes of this feature being backported to 7.x.
Therefore a string value (old API) indicates that the same class should be used for both methods, whereas an array value (new API) indicates a per-method class setting.
Comment #4
pillarsdotnet commentedComment #5
pillarsdotnet commentedRevised patch with more verbose logic that may possibly pass sun coding standards.
Comment #6
sun1) a) Missing spaces in function argument default value. b) Superfluous white-space in control structure conditions. c) The conditions should not be wrapped.
2) Whether this API change can be backported to D7 is a question that has to be deferred. For now, only a proper implementation for D8 matters. I'd like to hear feedback from others, but it likely means that we want to have consistent system variable values; i.e., all being arrays, no support for string values. Otherwise, modules that are trying to adjust these variables (and potentially variable values of other modules) would have to care for the different data types on their own all over the place. Ironically, this very Mail API had a very similar weirdness that allowed modules to set the mail body to a string or to an array, which was a major pain.
Comment #7
pillarsdotnet commentedOkay, I was wondering about that. Fixed.
Obviously you haven't looked at the updated patch in #5. That's okay. Ignore that one and look at the patch in #7 instead.
My eventual goal is to get the entirety of the Mail System module added to core. I have therefore been maintaining 8.x, 7.x, and 6.x branches of that module. The patch in this issue will help Mail System become core-worthy. If and when that happens, no module should ever have to directly modify the
mail_systemvariable.So you don't want any patches added to D8 with the intention of backporting to D7, because you think that D8 shouldn't care about backwards compatibility. I hope your opinion is not shared by other reviewers, especially those who have D8 checked out or installed anywhere.
Comment #8
pillarsdotnet commentedComment #9
pillarsdotnet commented@#6
Perfect example of a sun coding standard that is not found anywhere in drupal coding standards.
Comment #10
pillarsdotnet commented#7: drupal_mail_system-1135262-7.patch queued for re-testing.
Comment #11
pillarsdotnet commented#7: drupal_mail_system-1135262-7.patch queued for re-testing.
Comment #12
pillarsdotnet commented#7: drupal_mail_system-1135262-7.patch queued for re-testing.
Comment #13
pillarsdotnet commented#7: drupal_mail_system-1135262-7.patch queued for re-testing.
Comment #14
pillarsdotnet commented#7: drupal_mail_system-1135262-7.patch queued for re-testing.
Comment #15
dwightaspinwall commented#7: drupal_mail_system-1135262-7.patch queued for re-testing.
Comment #17
dwightaspinwall commentedIs this issue still relevant? If so, I'd be happy to re-roll the patch in #7.
Comment #18
yesct commentednext step, verify the issue still exists, write/update steps to reproduce
Comment #19
pelicani commentedbeginning to manually test
Comment #20
pelicani commentedit appears that the patch in #7 refers to the mail.inc file in the wrong location
the patch points to includes/mail.inc
but the current d8 has the file in core/includes/mail.inc
the coding standards also may be debated and we should review to make sure they are up to standard.
Comment #21
pelicani commentedI took the patch provided by @pillarsdotnet and applied it to the current mail.inc.
I copied and pasted the code exactly without any changes of my own.
The only unclear change is with the reference to 'MailSystemInterface' vs 'Drupal\Core\Mail\MailInterface'.
It is referenced in the examples and the comments.
I chose to use the MailSystemInterface as posted by @pillarsdotnet.
Comment #22
pelicani commentedI think I should have changed the status.
changing status to needs review.
Comment #23
Gaelan commentedRemoving 'needs reroll' tag.
Comment #24
oadaeh commentedI'm betting this entire control structure will need to be redone.
I also don't think, at this late stage, it will make it into 8.x.
Comment #25
berdirSee also #1889644: Convert drupal_mail_system() to a MailFactory service to allow more flexible replacements, which does not directly resolve this but makes it much easier and less ugly to support this in mailsystem.module.
Comment #26
catchOught to be possible with a bc layer.
Comment #42
smustgrave commentedThank you for sharing your idea for improving Drupal.
We are working to decide if this proposal meets the Criteria for evaluating proposed changes. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or there is no community support. Your thoughts on this will allow a decision to be made.
Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.
Thanks!
Comment #43
berdirLets close this, mailsystem supports this and the core system will be replaced with something that looks very different eventually.