1. Go to newsletter/subscriptions
2. Leave all newsletters unchecked
3. Enter an email address
4. Submit by clicking either Subscribe or Unsubscribe
Instead of an error message, the following wrong message is displayed:

You were added to the chosen mailing list.

Comments

anrikun’s picture

Actually, it is the form itself that is wrong:
The displayed message is the same :

Select the newsletter(s) to which you want to subscribe or unsubscribe.

when submit buttons may be different:
"Update" for authenticated users.
"Subscribe" and "Unsubscribe" for anonymous users.

simon georges’s picture

Component: Code » Usability

I'd eventually change the message to "You were added to the chosen newsletter(s)." to have the same words on every screen, but there is a different message for anonymous (this one) and authenticated ("your subscriptions have been updated").

What messages would you use (both on form header and after form submit) ?

anrikun’s picture

StatusFileSize
new26.5 KB
new27.69 KB
new25.86 KB

Here are 3 screenshots to better describe the issue (in French):

Issue #1

anonymous-form.png:
The header message is correct: "Select the newsletter(s) to which you want to subscribe or unsubscribe."
("Select the newsletters you want to subscribe to or unsubscribe from" would be better though but I'm not a native english speaker so I can't really tell...)
But when submitting without checking any newsletter, you get anonymous-form-submitted.png:
Instead of displaying the expected error message "You must select at least one newsletter.", it displays the wrong notice "You were added to the chosen mailing list." (nothing happens in the background, only the notice is wrong)

Issue #2

authenticated-form.png
The header message is wrong: it should be something like "Check the newsletters you want to subscribe to. Uncheck the ones you want to unsubscribe from."

anrikun’s picture

Status: Needs review » Active

Issue #3

simplenews.subscription.inc: line 298
Checking !$subscription alone is not enough as simplenews_get_subscription() never returns an empty value.

anrikun’s picture

Status: Active » Needs review
StatusFileSize
new2.71 KB

Issue #4

The message "You were added to the chosen newsletter(s)." is indeed inappropriate. Why not simply use the same message everywhere?
drupal_set_message(t('The newsletter subscriptions for %mail have been updated.', array('%mail' => $form_state['values']['mail'])));

The attached patch seems to fix all the issues described here.

anrikun’s picture

Status: Active » Needs review

I'm a bit worried: simplenews 6.x-2.0-alpha2 is out and this patch has been skipped, surely because nobody has reviewed it yet.
Am I the only one affected by the 4 issues above?
Especially, issue #3 is an important bug.

simon georges’s picture

I've released a new version because the "critical" bugs have been fixed. This patch has not been skipped, it just wasn't in our priorities. It will be taken into account some day.

anrikun’s picture

Thanks for your answer Simon.
I'm just concerned about the fact that nobody else has reported having the same issues :-)

ambient.impact’s picture

Subscribing. This bug is especially confusing to my client's multilingual site visitors, as it seems to only display the English version, regardless of the current language. Using 6.x-2.0-alpha2. Hope this gets fixed sooner rather than later.

anrikun’s picture

@Ambient.Impact: Subscribing is OK but have you reviewed the patch? Does it work?

anrikun’s picture

Bumping this. Did somebody review the patch?

berdir’s picture

Version: 6.x-2.x-dev » 7.x-1.x-dev

This has probably a much higher chance of being applied to 7.x-1.x first (because that's what we are actively developing now) and then backport. Let's see if the patch applies...

sgurlt’s picture

Version: 7.x-1.x-dev » 6.x-2.x-dev

Gonna check this out today and will review it later ;)

anrikun’s picture

@Berdir: I reported this bug for 6.x-2.x, not 7.x-1.x-dev.
I don't even know if the bug exists in 7.x-1.x-dev.
Before changing the version of this issue, we need to check whether the bug is also present in 7.x-1.x-dev or not.

berdir’s picture

Version: 6.x-2.x-dev » 7.x-1.x-dev

Looks like we're good at crossposting today..

berdir’s picture

@anrikun

Yes, it needs to be tested and most likely this bug exists in 7.x-1.x too. This feature has been ported to 7.x-1.x recently and has not been changed since then, nor are there any tests for it. So it is very likely that the bug also exists in 7.x.

Active development from our side (MD Systems) is now focused on the 7.x-1.x branch. The patch has been lying around for more than half a year for 6.x-2.x, I will however try to commit this on 7.x-1.x before the end of the year. And once it has, including tests, it will be much more likely to be commited to 6.x-2.x as well.

berdir’s picture

StatusFileSize
new2.71 KB

Re-uploading the patch from #5 to trigger the testbot.

Status: Needs review » Needs work

The last submitted patch, includes_simplenews.subscription.patch, failed testing.

sgurlt’s picture

Version: 7.x-1.x-dev » 6.x-2.0-alpha2
Status: Needs work » Fixed

I tried the patch from #5 and it worked perfectly for me, thx !

berdir’s picture

Version: 6.x-2.0-alpha2 » 7.x-1.x-dev
Status: Fixed » Needs work

Please stop changing the version, thanks.

berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new2.71 KB

Only problem was that the patch wasn't using the new -p1 compatible format (e.g. an a/b prefix). Re-rolled.

berdir’s picture

StatusFileSize
new7.53 KB

And now with tests which confirm that there was an error that is now fixed. The mail isn't nested inside ['subscriptions'].

Will commit once it has passed the tests.

berdir’s picture

Actually, the ['subscriptions'] behavior is different for the multi subscription block and the newsletter/subscriptions page.

Added tests for the latter as well and checking $user instead of the field now.

berdir’s picture

Version: 7.x-1.x-dev » 6.x-2.x-dev

Ok, commited, back to 6.x-2.x with this...

berdir’s picture

berdir’s picture

Status: Needs review » Patch (to be ported)
anrikun’s picture

Will this be committed to 6.x-2.x soon?
simplenews 6.x-2.0-alpha3 is out and it is not in it :-(

simon georges’s picture

@anrikun, sorry about the delay, I've no client using the module, so I haven't reviewed every case you patched...

berdir’s picture

Note that the patch most likely needs to make similar changes as I did in the 7.x-1.x, to work with the "new" multip-signup block. That's why the status is set to "patch (to be ported)".

anrikun’s picture

Who should port the patch then?

berdir’s picture

You could :)

I'm only working on the 7.x-1.x branch, do not expect any work from my side on the 6.x-2.x branch

truyenle’s picture

either #5 or #22 does work for me. Thanks

  • Berdir committed f783b9d on 8.x-1.x authored by anrikun
    Issue #1099352 by anrikun, Berdir: Fixed wrong message is displayed when...