Hello,
I was testing the module and noticed that there is a condition that when checkbox "Receive node follow-up notification e-mails" option should appear, but doesn't.
When you give a user permission to create Blog content type (and not pick anything else on admin/user/permissions page), and also pick "Blog entry" from comment notify settings (admin/settings/comment_notify), it appears that logic fails at line number 290, thus it will never populate checkbox form.
The line ask for logic, where it looks for user_access that has create 'content' however, as far as I can tell, blog is 'entries' rather than 'content'.
I have tried the logic
if (user_access('create '. $type->type .' content') || user_access('create '. $type->type .' entries'))
and appear to work as expected.
If this is already addressed, please ignore this.
Thank you!
Shino
Comment | File | Size | Author |
---|---|---|---|
#10 | 717590-commentnotify-node-access-D6.patch | 764 bytes | Dave Reid |
#8 | 717590-commentnotify-node-access-D7.patch | 3.56 KB | Dave Reid |
#7 | 717590-commentnotify-node-access-D7.patch | 3.51 KB | Dave Reid |
#2 | 717590-commentnotify-node-access-D7.patch | 709 bytes | Dave Reid |
#1 | 717590-commentnotify-node-access-D6.patch | 764 bytes | Dave Reid |
Comments
Comment #1
Dave ReidConfirmed. This should use node_access('create', $type->type) instead since that can handle all possible node types and access implementations.
Comment #2
Dave ReidSame patch for D7 branch.
Comment #3
gregglesIt seems this doesn't work for forum nodes but I have no idea why that would be.
#727978: Notify node author on forum threads.
Comment #4
gregglesJust found this in another module: it's got to be $type->name instead of $type->type.
Comment #5
gregglesHaha, bad logic in that other module last night. I am back to stumped...
Comment #6
tito.brasolin CreditAttribution: tito.brasolin commentedThe problem happens with blog, forum, ubercart and possibly other modules because of their different naming convention rules in implementation of hook_perm: 'create blog entries', 'create forum topics' and 'create products' permissions are skipped by comment_notify which only allows 'create '. $type->type .' content' permissions.
I don't think comment_notify on Drupal 6 can be patched to take into account all possible use cases, so i solved my issue by means of http://drupal.org/project/config_perms
I added a new 'create blog content' permission with path 'node/add/blog' and assigned it to my registered users: now the checkbox is shown, the trick would work as well with 'product' or 'forum'.
By the way, a different workaround could have been the creation of a 'dummy' content type with 'create dummy content' permission for my registered users, hiding the corresponding 'create' link from the menus. I didn't like the idea of a useless content type in my system, but it may be a good solution if you don't want to install additional modules.
Comment #7
Dave ReidRevised patch for D7.
Comment #8
Dave ReidAnd the real patch this time...
Comment #9
gregglesFixed for 7.x: http://drupal.org/cvs?commit=445086
Thanks, Dave.
Comment #10
Dave ReidRe-attaching the D6 patch that still applies.
Comment #11
gregglesAwesome, thanks Dave http://drupal.org/cvs?commit=445108
Comment #12
tito.brasolin CreditAttribution: tito.brasolin commented... oops! I missed the patch Dave already posted on February. Well, it looks like content_notify definitely can be patched to take into account all use cases: thank you, Dave!