The number in the newsletter listing show the amount of actual subscribers of the newsletter. But it should show the count of subscribers when the mail was sent.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

miro_dietiker’s picture

Status: Active » Fixed
FileSize
9.03 KB

The attached patch is already committed in Branch 6.2

miro_dietiker’s picture

Version: 6.x-2.x-dev » 7.x-1.x-dev
Status: Fixed » Patch (to be ported)

Some work todo ;-)

roball’s picture

Version: 7.x-1.x-dev » 6.x-2.x-dev
Priority: Minor » Critical

The Drupal database update (update.php) #6201 will fail if your tables use a prefix. Line 728 of "simplenews.install" originally reads

  db_query("UPDATE {simplenews_newsletters} sn SET sent_subscriber_count = (SELECT count(tid) FROM simplenews_snid_tid WHERE tid = sn.tid AND status = %d)", SIMPLENEWS_SUBSCRIPTION_STATUS_SUBSCRIBED);

but must be changed to

  db_query("UPDATE {simplenews_newsletters} sn SET sent_subscriber_count = (SELECT count(tid) FROM {simplenews_snid_tid} WHERE tid = sn.tid AND status = %d)", SIMPLENEWS_SUBSCRIPTION_STATUS_SUBSCRIBED);

Table names must ALWAYS be put within curly brackets!!!

roball’s picture

Status: Patch (to be ported) » Needs work
miro_dietiker’s picture

Version: 6.x-2.x-dev » 7.x-1.x-dev
Status: Needs work » Patch (to be ported)

The issue is fixed with the patch from
http://drupal.org/node/823688#comment-3304620
and it's already committed to Branch 6.2

miro_dietiker’s picture

I needed to move things around additionally
#884338: Spool duplication on node resave

fmjrey’s picture

FileSize
99.82 KB
100.9 KB

I think this needs to be worked a bit further in the case of i18n newsletters.
When a newsletter has translations, each translation is listed in the newsletter issues page (admin/content/simplenews/sent).
However, the number of subscribers and the count of mail sent is only reported against the version in english (in default language I suppose).
In the attached screenshots, issue 4 has been has been translated from english to french. One subscriber is subscribed to the english version, another to the french version. Instead of seeing against both (0/1) before cron has run, I saw (0/2) against the english version. After running cron manually, (2) was reported against the english version.

Edit: my post is about 6.x-2.x-dev, not D7

miro_dietiker’s picture

Version: 7.x-1.x-dev » 6.x-2.x-dev
Status: Patch (to be ported) » Needs work

Uff... i didn't consider the 1:n relationship for the translated nodes in this code...
I'm not happy with simplenews node spooler handler anyway.
Indeed when editing translations of a just pending/sending node it could lead to duplicates...

Currently the creation of the spooler recipients is also not satisfying. They get fetched from SQL into $mails and inserted back again one by one.

The creation of the recipient list should be clearly limited to a one-time action per node - where the counters are generated.
Additionally considering the creation of this in 1:n translations will make this complete.

roball’s picture

Title: Wrong number of subscribers in the newsletter listing » Wrong "Sent" numbers on "Created issues" list

Just wanted to confirm that the "Sent" numbers at admin/content/simplenews/sent are now correct. Thanks for the fix!

Sylvain Lecoy’s picture

We can close the ticket isn't it ?

miro_dietiker’s picture

I don't think it's correct in multilingual sending. I plan to work on this - so please leave open.

roball’s picture

Priority: Critical » Minor

Just let's tag it back to the original priority.

miro_dietiker’s picture

Minor priority is right.
The wrong counter are now by intention.

We'll delay rewriting the ML API which is needed to have correctly working counters.

We simply count the grand total reported on the translation source. All translations count 0 atm, although they've been considered when sending.

#996392: Multilanguage support