Using version 2.1 since php 6.3 requirement of 2.2 i don't know if the issue is present in 2.2 too.

I have only 1 newsletter scheduled to send once per month, the newsletter subscription field appear in user profile, checkbox is deactivated by default.

The scheduler works, new issues are created and subscriber receive newsletters correctly but if I add a new user from admin->add user submitting the form i get errors like:

ERROR: Title pattern for new edition nodes field is required!

unistalling redownloading and reisntalling allow me to add 1 user manually without errors, the second user I try to add i get the error, somethime i get more errors like "star sending on is not valid..."

it happens with the newsletter checkbox enabled or disabled

I noticed that after newsletter checkbox (in the create new user page) there is an hidden fieldset in the html source code of the page is that normal?
In this fieldset there are all the options you have in the "Send newsletter according to schedule" page too:

Send once per:
Start sending on: *
Stop sending:
Title pattern for new edition nodes: *

all those fields are hidden and their values do not reflect the settings saved in "Send newsletter according to schedule" page..

am I missing something? any hint would be welcome!

watchdog message:
Referrer http://inaatc.it/en/admin/user/user/create
Message Illegal choice in scheduler element.

Comments

misthero’s picture

I don't know if it's the correct solution, but for now I solved changing the contition when the fieldset should appear in simplenews_scheduler.module

i copied the condition from here: http://drupal.org/node/1461152

replacing:
if (isset($form['simplenews']) && user_access('send scheduled newsletters') && !isset($node->simplenews_scheduler_edition)) {

with:

if (user_access('send scheduled newsletters')) {
   // Make sure that this is not an edition.
    $node = node_load($form['nid']['#value']);
    if (isset($form['simplenews']['send']) && !isset($node->simplenews_scheduler_edition)) {

now the fieldset doesn't appear in admin/user/user/create anymore but works and appear correctly in the schedule page

I don't know if there some side effect i would like some feedback on this. Thanks!

joachim’s picture

Status: Active » Needs review
StatusFileSize
new1.1 KB

Thanks for reporting this and doing some digging on it :)

I'm taking a slightly different approach with this patch though: on D6 we have the wonderful hook_form_FORM_ID_alter() and we can use that to keep this module out of the add user form where it has no business sticking its nose in at all!

Here's a patch which passes all tests. Can you give it a try please?

> $node = node_load($form['nid']['#value']);

Well spotted on this one BTW. Though I'm going to leave that for the issue where it's reported, #1379284: simplenews_scheduler_form_alter() checks a nonexistent $node

misthero’s picture

Yes! Tested and it works for me, the hidden fieldset doesn't appear anymore in user creation form.

thanks for your fast answer!

joachim’s picture

Thanks for reviewing.

Reason I'm dragging my heels committing this is that it will pretty much irrevocably break support for Simplenews 1.x: see #1570062: SIMPLENEWS_COMMAND_SEND_NONE defined twice: incompatible with Simplenews 1.x?.

joachim’s picture

Status: Needs review » Fixed

Committed! Thanks for testing, and sorry for the delay.

- #1581808 by joachim: Fixed admin creation of users broken by form alteration.

misthero’s picture

thx but.. what version did you updated? 2.1 or 2.2?

joachim’s picture

New fixes always go into the dev version.
Stable releases are never changed.

This probably does warrant a new release...

joachim’s picture

2.3 is now out :)

misthero’s picture

yes, sorry, but wich one, like i said in my first post i cannot use 2.2 cause it requires (i think) php 6.3+, just wondering if i should update or not..

and the 6.x-1.x-dev is still last updated in 2011

joachim’s picture

The fix is only in the latest version.

Like I said, existing releases cannot be changed.

So you will need PHP 5.3 to run the latest version. That, or help tackle the issue to support 5.2! (Though note PHP 5.2 is now obsolete!)

misthero’s picture

I know, but i can't, i would update to php5.3 if i could but is not my own server, i think i messed things up now trying to update.. I cannot see version 2.1 anymore on main page, is possible to leave that there as optional "not recommended", or is there some place where i can download the old version? I will patch it manually again...

thank you for all your work and support joachim but i know for sure many servers are still on php 6.2 maybe leaving that version available and unsupportet for a little longer could help, at least while people update their servers.

misthero’s picture

ok i found the spanshot in the rep :)

thanks again for your support!

joachim’s picture

There's a 'view all releases' link at the bottom of every project page :)

Badger your hosting to upgrade their PHP is the only solution I'm afraid!

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

more details added