Whether I use views_embed_view() with the PHP filter, or the Insert View filter, when I create a new newsletter edition I get the views admin links included in the new edition body text.

This is obviously because I'm doing this as an admin user, but does that mean that if cron happens to be run as uid 1, users will receive a newsletter with (to them) junk HTML.

Comments

dgtlmoon’s picture

You're not running cron.php from the web browser are you? that would be bad.

but either way, i think it should check for this

joachim’s picture

I'm currently testing new editions by running _simplenews_scheduler_new_edition() in the Exec PHP block... ;)

One fix might be to switch users to uid 0 within _simplenews_scheduler_new_edition() during the node body building process and switch back again.

joachim’s picture

Title: Views admin links appear in edition node body » Views admin links appear in edition node body - render edition nodes as the anon user
Status: Active » Needs review
StatusFileSize
new1.11 KB

Here's a patch that switches to the anon user to render the node.

joachim’s picture

Status: Needs review » Fixed

Fixed.

Status: Fixed » Closed (fixed)

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