Closed (fixed)
Project:
Subscriptions
Version:
4.6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
30 Jun 2005 at 22:52 UTC
Updated:
4 Mar 2006 at 23:56 UTC
When you create a node with subscription module activated, will always display the checkbox : "Receive notification of replies..." by the end of node form.
The problem is that subscriptions_nodeapi doesn't check if comment are allowed for this node. Just add $node->comment == 2 to correct this.
This gives you :
case 'form post':
if (!$user->subscriptions_auto && $node->comment == 2) {
$allsubs = subscriptions_get_user();
$val = isset($node->subscriptions_subscribe) ? $node->subscriptions_subscribe : $allsubs['node'][$node->nid] ? 1 : $user->subscriptions_subscribe;
return form_item(t('Subscribe'), form_checkbox(t('Receive notification of replies to this %name.', array('%name' => node_invoke($node, 'node_name'))), 'subscriptions_subscribe', 1, $val));
}
Comments
Comment #1
erikhopp commentedi have tried this, and the subscription checkbox still shows up for me when i am an anon user.
instead i tried adding " && $user" to check if there was a user id, but that didn't work either.
erik
Comment #2
tostinni commentedYou don't adress the right variable. You need to check
$user->uidbecause $user will always exists even if it's an anon user.So here is the new patch :
Good luck
Comment #3
dziemecki commentedI'll give this a test and commit if it works.
Comment #4
dziemecki commentedThis fix has been committed.