In devel.mail.inc you are adviced to
* To enable, save a variable in settings.php (or otherwise) whose value
* can be as simple as:
*
* $conf['mail_system'] = array(
* 'default-system' => 'DevelMailLog',
*);
This causes an override because the simple fact that variable_get (used by the Mail System module) gets the value from settings.php in stead of the variable table. This also means that calls to mailsystem_set has no effect. (Which is what made my file this report - wasted some time on tracking down why mailsystem_set didn't work in my module.)
I think there should be a warning saying that you should remove this from settings.php before enabling the Mail System module - or maybe just recommend to use the Mail System module to enable this?
Update: The Devel developers suggests in comment 9:
The real solution is for the Mail System module to check this in hook_requirements() and tell the user what to do.
Comment | File | Size | Author |
---|---|---|---|
#6 | devel-2841588-6.patch | 1.16 KB | hansfn |
|
Comments
Comment #2
gnugetI think this is the way how it should work.
Why you have:
If you don't want to use it.
Overwrite variables setting them in the settings.php file is a feature not a bug.
Comment #3
hansfn CreditAttribution: hansfn commentedI just ask for the possible problem to be documented. No where do I claim it is a bug.
When I added the $conf setting to settings.php, before I started using Mail System, I didn't realize it could be a problem later. I'm just that stupid ;-)
Comment #4
gnugetoh I see, sorry :-)
Comment #5
willzyx CreditAttribution: willzyx commented@hansfn thanks for reporting.
I'm closing this issue because, as said by @gnuget, this is absolutely expected; is the way how it should work when you override variables in settings.php.
Feel free to reopen if you want to post a patch for improve the documentation. Thanks!
Comment #6
hansfn CreditAttribution: hansfn commentedOK, I have no problem writing a patch - attached.
I think you are missing the point about this report. It is not obvious that the Mail System module uses the 'mail_system' variable and that the suggestion in devel.mail.inc will basically disable the module. The Mail System module could have used another variable.
PS! In D8 this doesn't seem to be a problem - the Mail System module works as intended even if the variable is added to settings.php.
Comment #7
willzyx CreditAttribution: willzyx commentedThanks for the patch!
personally l do not think that the dockblock should contains any reference to the Mail System module
If you want a good inspiration for improve the documentation you can take a look at the 8.x DevelMailLog dockbloc :)
Comment #8
hansfn CreditAttribution: hansfn commentedIf something has unexpected consequences, I think it should be documented. (In Drupal 8 there is no such problems.) Anyway, I guess I have made enough traces in this issue that other people with the same problem will find it with Google. I will not spend anymore time on getting this committed.
Comment #9
salvisI agree with #7. We should not advertise a third-party module in our docblocks.
The real solution is for the Mail System module to check this in hook_requirements() and tell the user what to do.
Sorry for wasting your time, hansfn.
Comment #10
hansfn CreditAttribution: hansfn commentedComment #11
hansfn CreditAttribution: hansfn commented