Closed (duplicate)
Project:
Simplenews
Version:
6.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Jan 2009 at 10:22 UTC
Updated:
24 Feb 2011 at 00:06 UTC
I noticed the cron does not uses the template files.
Test mail and sending without cron are using the template files correctly (if exist in theme folder)
Regards
Comments
Comment #1
sutharsan commentedIs it just cron not using the template files? Does it work with poormanscron, test-emails, send immediately without cron? Did you update the registry?
If it is only cron, I think the whole email sending by cron has to be reviewed. Cron does not do a full bootstrap (related issue) which may cause it to skip drupal's theming abilities.
Comment #2
sutharsan commentedWhat version of Drupal do use? (See #344625: Themes disabled on cron)
Comment #3
Docc commentedIm using 6.8.
With test-emails/send immediately without cron it works fine.
Did not used poormanscron.
So its only cron. Il take a look at the bootstrap issue and report back.
Comment #4
sutharsan commentedCron does a full bootstrap (see cron.php). I realized that cron runs as anonymous. Is the theme visible for anonymous users?
See: #256795: Allow simplenews cron to send nodes that anonymous users cannot access
Comment #5
pieterbezuijen commentedI'm using Drupal 6.9 and also got problems with templates and cron.
Tried applying patch metioned in #4, no succes. My theme is visible for everyone.
I took a closer look to the e-mail that is sent and saw that the mail.css is attached, could this be a mimemail issue?
Comment #6
sutharsan commentedDuplicated by #374222: Template files do not work when using admin theme
Comment #7
sutharsan commented@pieterbezuijen: mail.css is attached by mime mail.
Comment #8
sutharsan commentedI have tested, but can not reproduce the problem. Getting the theme registry to recognize the new .tpl.php is not easy. But when it does, cron does use the template files. Marking it as won't fix.
Comment #9
sutharsan commentedDuplicated by #373939: Unable to set up multiple template files in a zen subtheme
Comment #10
Docc commentedFinally found the time to look into it. And could bang my head into the wall for not thinking about this earlier.
I use a different theme for the admin pages including for editing content.
So when i send without cron it uses the admin theme. When sending wit cron it uses the theme for the anonymous user.
So you could say this is a Drupal design issue (its a design problem i think) but it could be a good practice for simplenews to always send a newsletter as anonymous.
Comment #11
pieterbezuijen commentedWow! This works:D Thanks Docc!
I use Rootcandy as admin-theme, but all template files are in my normal theme. Tried copying my template-files to the Rootcandy-theme and this works.
Would this be a Drupal issue?
Comment #12
webel commentedI would like to confirm this problem. When sending Newsletter (after editing) as admin or as any role authorised to send newsletters - and ONLY when using Cron - the template files are skipped ! Left me completely bamboozled until I found this issue report (many thanks). My template files are under the main site theme.
Comment #13
drupalfan2 commentedWhen will this problem be solved?
Comment #14
hansrossel commentedI'm having the same problem.
My installation uses Rubik/Tao (which are the admin themes from the admin module) as the admin theme.
- Test version: When sending the test newsletters the custom front theme of the site is used and the simplenews-newsletter-body--25.tpl.php template files in there. php code in my template file is printed and the views_embed_view code in there.
- Sending directly: When sending the real newsletter directly (so not using cron) the custom front theme of the site is used and the simplenews-newsletter-body--25.tpl.php template files in there. php code in my template file is printed and the views_embed_view code in there.
- Sending on cron: When sending the real newsletter on cron the admin theme Rubik is used and the simplenews-newsletter-body--25.tpl.php template file inside Rubik. php code in my template file is printed BUT the views_embed_view code is not printed.
I tried it both with htmlmail and mimemail, same result. Using normal cron, not poormanscron.
Comment #15
sgabe commentedThis is a duplicate of #374222: Template files do not work when using admin theme.
Comment #16
aries commentedThe root of the views_embed_view() problem can be the different language filter.
Eg:
The i18n.module overwrites the query in the sanitize part of nodereference_field() in nodereference.module (around line 262). If the sites' default language is 'en' (because the admin forget to give a prefix for the english language) but the user who checks the site has the default language 'nl', then the view will execute different queries for cron runs and for the user.
Fortunately, in the nodereference case, you can override this in the formatter's theme function. Eg.
To debug the views and cck shorten the people's lifetime more than the Philip Morris. ;)
Comment #17
kumkum29 commentedHello,
I'm having exactly the same problem.
Did you find a solution with the cron ?
Comment #18
mordonez commentedIn D7 you can resolve the problem running the cron outside of admin, as http://domain.com/cron.php?cron_key=XXXXXXXX