Closed (outdated)
Project:
HTML Mail
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Feb 2013 at 02:52 UTC
Updated:
29 Sep 2020 at 20:30 UTC
Jump to comment: Most recent
Comments
Comment #1
derekw commentedHave the same error message. Error message appears and messages are sent without using the template. If I flush the theme registry cache, error message disappears and messages are sent using the template again.
I think it may be occurring after I run the Drupal module update script.
Comment #2
summit commentedHi,
I got the same error using a custom htmlmail.tpl.php template.
What could be the problem?
Greetings, Martijn
Comment #2.0
summit commentedcleaned up formatting a bit.
Comment #3
wadmiraal commentedDerekw is right. It does happen on
/update.php. But it's not HTML Mail, but Mail System that's the culprit.It took me a while to figure this one out, but here's what's happening:
When we run
/update.php, Drupal clears all the caches (which is normal). The problem is that the mailsystem module uses a theme registry alter hook to put in some custom theme info. This is necessary if you use a different theme for the emails than the site theme. It needs information about Drupal's file structure for this (drupal_get_path, etc).Problem is: when in update.php context, the file system information is not available (same as in install context). Modules are not supposed to use
module_load_*functions, ordrupal_get_path, when being installed/updated. This is normal, and keeps critical install logic encapsulated.So, when the cache is cleared after update, the theme registry is cleared as well. Mailsystem tries to alter the theme registry, fails because it needs file system information, thinks there is no specific email theme so does not trigger an error, and the emails are sent "blank".
The only fix I see: make it a habit of clearing the Theme registry after each update. There's no clean way to do this in code.
Edit: add some formating.
Comment #4
oligodosh commentedHad the same issue when using a different theme to handle the htmlmail templates.
After reading wadmiraal's comment I was able to solve the issue following this procedure:
Fatal error: Call to undefined function mailsystem_html_to_text() in D:\drupal-7.23\sites\all\modules\htmlmail\htmlmail.mail.inc on line 62The configuration appears to be stable so far even after all caches have been cleared.
Comment #5
salvis