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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dave Reid’s picture

Version: 6.x-1.3 » 6.x-1.x-dev
Status: Active » Needs review
FileSize
764 bytes

Confirmed. This should use node_access('create', $type->type) instead since that can handle all possible node types and access implementations.

Dave Reid’s picture

Same patch for D7 branch.

greggles’s picture

Status: Needs review » Needs work

It seems this doesn't work for forum nodes but I have no idea why that would be.

#727978: Notify node author on forum threads.

greggles’s picture

Just found this in another module: it's got to be $type->name instead of $type->type.

greggles’s picture

Haha, bad logic in that other module last night. I am back to stumped...

tito.brasolin’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Needs review » Needs work

The 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.

Dave Reid’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Needs work » Needs review
FileSize
3.51 KB

Revised patch for D7.

Dave Reid’s picture

And the real patch this time...

greggles’s picture

Fixed for 7.x: http://drupal.org/cvs?commit=445086

Thanks, Dave.

Dave Reid’s picture

Status: Needs work » Needs review
FileSize
764 bytes

Re-attaching the D6 patch that still applies.

greggles’s picture

Status: Needs review » Fixed
tito.brasolin’s picture

... 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!

Status: Fixed » Closed (fixed)

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