From c14c9ce8303a52efeb11ab89520e285ad4c6ae5b Mon Sep 17 00:00:00 2001 From: Pol Dell'Aiera Date: Fri, 2 Sep 2011 13:24:50 +0200 Subject: [PATCH] Fix #374222: template files do not work when using admin theme --- simplenews.module | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/simplenews.module b/simplenews.module index 53db457..ac1b116 100644 --- a/simplenews.module +++ b/simplenews.module @@ -858,11 +858,23 @@ function simplenews_form_alter(&$form, $form_state, $form_id) { * Implementation of hook_cron(). */ function simplenews_cron() { + $theme_default = variable_get('theme_default', ''); + $admin_theme = variable_get('admin_theme', $admin_theme); + $backup_custom_theme = $GLOBALS['custom_theme']; + + if ($admin_theme != $theme_default) { + $backup_custom_theme = $GLOBALS['custom_theme']; + $GLOBALS['custom_theme'] = $theme_default; + } + module_load_include('inc', 'simplenews', 'includes/simplenews.mail'); simplenews_mail_spool(); simplenews_clear_spool(); // Update sent status for newsletter admin panel. simplenews_send_status_update(); + + $GLOBALS['custom_theme'] = $backup_custom_theme; + } /** -- 1.7.4