Hi,

I'm getting the following fatal error when a user sign up for a newsletter at site_name/newsletter/subscription

Fatal error: Call to undefined function _simplenews_template_message() in .../simplenews_template.module ... on line 183

I can add users manually and send out a test newsletter without any problem. It's only when they try to sign up for a newsletter that it bombs out.

Drupal 5.13
PHP 5.2.5
MySQL 5.0.67.d7

Mime-Mail 5.x-1.0
Simplenews 5.x-1.5
Simplenews Template 5.x-1.4 (not RC1)

Is there something I can do? Let me know if additional information is needed. Thanks and keep up the great work!

Comments

twirlingsky’s picture

I'm having the same problem with Drupal 5.15

faulkner161’s picture

Hello,

I am also experiencing this problem! Any help on this issue would be much appreciated!

tobiass’s picture

Same problem here

joanpc’s picture

u can fix it adding a:

function simplenews_template_init() {
  require_once _simplenews_template_path('simplenews_template.inc');
}

in simplenews_template.module

faulkner161’s picture

It's weird, because we fixed fixed, simply turning off the option which requires mimemail to send html emails. Am I assuming that if you want this function to work and do want mimemail to send all of your emails, that you would then include this function, as mentioned above?

pharoz’s picture

Status: Active » Fixed

Sweet. Adding that function seem to do the trick. Thanks!

tobiass’s picture

#4 worked for me. Thank you!!

digidoo’s picture

If problems still occur, especially when caching is on, have a look at: http://drupal.org/node/383562

marcus_clements’s picture

This worked for me too...

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

jju’s picture

Status: Closed (fixed) » Needs review

I make a new solutions witch work also cached mode. THe original patch not work in cached mode.

rewrite theme_mimemail_message functio in simplenews_template.module

/**
 * Overriding theme_mimemail_message().
 */
function phptemplate_mimemail_message($content) {
  if (function_exists('_simplenews_template_message')){
    return _simplenews_template_message($content);
  } else {
    require_once _simplenews_template_path('simplenews_template.inc');
    return _simplenews_template_message($content);
  }
} 

The code was tested in caced and uncached mode, and its work.

hanoii’s picture

Status: Needs review » Closed (duplicate)

Isn't this a dupe of #393218: Call to undefined function _simplenews_template_message()? Also, by looking again at the patch there in #1 which I submitted quite some time ago there are another function that the .inc has to be put.

@jju: My patch does pretty much the same as yours, although it makes no sense to query for the existence of the function, a require_once() just work.