Hi,

i am using Drupal 5 latest subscription module.
- I use the subscriptions_content and subscriptions_taxonomy.
- User subscribers to a certain taxonomy tag - for NEW and COMMENT only (and not for UPDATE)
- a node is submitted using this tag, but is not set to "published"
- afterwards, node is actually published.

Result - no subscriptions email is sent.

I saw that the Notification module does treat setting the "published" of a node as if the node was created, which sounds like a more standard behavior.

Only way to work around this is to subscribe to updates on the node - but most users don't want that.

Can you please help,

thanks,
Noam,

Comments

salvis’s picture

Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

How do you set the node to published?

Have you tried doing it via node/NID/edit or admin/content/node/overview? Both of these should work.

noamdanon’s picture

trying it using node/nid/edit.

again, exact flow is this:
- user subscribers to tag1, but only to new - no updates
- i submit a new node with tag1, and set published=FALSE
- entry is added to subscription_queue
- i run cron - no email is sent (node is not published yet)
- i change the node to published=true
- nothing is written into subscription_queue...

If i do the same but publish directly, everything works nicely.

noamdanon’s picture

Title: subscribing to unpublished nodes never creates the notification when it is finally published » how about this fix?

i just made the following fix to subscriptions_content_nodeapi line 212:

instead of the original:
'action' => $op,

i put:

'action' => ($op == 'update' && $unpublished_nid == $node->nid && $node->status ? 'insert' : $op),

same as done for the is_new field of the event.
now it does work very nicely.

i did not go into the full details of the rest of the code, but it seems that if the action is set to 'update', the code adds an extra WHERE filter to the subscriptions table, looking only at those that have "send_updates=1".
setting the action in this case to 'insert', overrides this.

Can someone verify that the change i made does not mess anything up?

salvis’s picture

Title: how about this fix? » D5: No 'new' notifications when unpublished node gets published
Status: Postponed (maintainer needs more info) » Active

Hmm, seems like 5.x is lagging behind 6.x in this respect. 6.x got the following fix:

http://drupalcode.org/viewvc/drupal/contributions/modules/subscriptions/...

Maybe this should go into 5.x as well...

I'm not sure this will work, but it would be my first try...

If detail publishing is not in 5.x, then bulk publishing most likely isn't in there either...

noamdanon’s picture

ok, excellent - I really appreciate this help!

this is basically very similar to my change, which means I was on the right direction.
any other things that you think i should take from the version 6?

salvis’s picture

Let us know if it actually works, and I'll commit it to the D5 version.

Look through the CVS history to see whether you find other updates that might be beneficial. I stopped dragging along the D5 version about half a year ago because no one showed any interest in providing any feedback whatsoever.

noamdanon’s picture

Seems to work fine, yes.
thank you,

salvis’s picture

Status: Active » Fixed

Ok, thanks for letting us know.

I've committed the D6 fix from #560146: Digest Subscriptions don't send if not set to "published" before cron runs to 5.x-2.x-dev as well. Give it up to 12h to be repackaged.

Status: Fixed » Closed (fixed)

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