Download & Extend

Comments submitted via email not getting published, even with permissions set to allow it

Project:Mailhandler
Version:6.x-1.7
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

I have the permission "publish comments without approval" set for all roles, even anonymous users, yet comments that get posted via mailhandler are not getting approved automatically.

Since Drupal checks that permission within the comment_save() function, I'm thinking this bug might have to do with the mailhandler_switch_user() function, but I'm not sure how. I'm guessing maybe it's not "cleanly" switching users, and thus confusing Drupal about permissions?

Comments

#1

You can use the following command in the mailhandler commands section:
status: COMMENT_PUBLISHED

I've tried it and it works. One word of warning, according to #394662: Comments via Mail2Web that are set to published do not trigger notification, using the following command doesn't trigger notifications in case you are using them.

I haven't tried using that command as a user who doesn't have permission to post comments without approval. I'm not sure if it overrides the permissions or not.

#2

Status:active» fixed

Quick update, I tried using the status: COMMENT_PUBLISHED with the new 2.0 version of messaging and notifications and it worked. Just in case that's why your using this as well.

I also tried posting as someone who didn't have permission to comment without approval and the comment WAS approved. Maybe there is another command that takes this into account.

I'm going to mark this fixed for now. If there isn't a command like that it sounds like it would be a good feature request.

#3

Status:fixed» active

I'll try using the command, but my point is that you shouldn't have to specify a command just to make the behavior of the module conform to the existing permissions on your site. For my site, any posted comment gets published immediately, so why should I have to use a command in mailhandler to get that same behavior? Still seems like a bug to me.

#4

i think it's a valid point but i wonder if this should be in the mail2web queue since that is the module responsible for handling comments via email?

#5

@wickamos, are you using mail2web? I believe this is an issue in mail2web, and I just committed a fix to the 6.x dev version for it http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/mail2web/ma... Can you test this out on a test site to see if it fixes your problem?

#6

Status:active» fixed

Fixed in 6.1, to be ported to 6.2 soon. Now you can explicitly set in commands and it will work, or, not set it at all, and it will use the permission system. While node_object_prepare works well for nodes, it does not work when you're posting a comment. This led to some other refactoring. Marking fixed http://drupalcode.org/viewvc/drupal/contributions/modules/mailhandler/ma...

#7

Status:fixed» closed (fixed)

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

nobody click here