Closed (fixed)
Project:
Comment Anonymizer
Version:
7.x-1.0
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 May 2011 at 22:13 UTC
Updated:
20 Aug 2012 at 20:09 UTC
My comment boxes do not show the checkbox defined in
function anon_comment_form_comment_form_alter(&$form, &$form_state) {
global $user;
//no need to alter the form if we're already anonymous
if ($user->uid == 0) {
return;
}
//implement the checkbox on the comment form
$form['anonymize'] = array(
'#type' => 'checkbox',
'#title' => t('Post this comment anonymously'),
'#default_value' => 0,
'#weight' => '10',
'#access' => user_access('comment anonymously when logged in')
);
I assume the weight of the created item is too low
the print_r($form)
....
[#submit] => Array
(
[0] => anon_comment_form_submit
[1] => comment_form_submit
[2] => anon_comment_log_author
)
[anonymize] => Array
(
[#type] => checkbox
[#title] => Post this comment anonymously
[#default_value] => 0
[#weight] => 10
[#access] =>
)
The anonymize is placed _last_ in the array as you may see in http://drupalbin.com/18726
| Comment | File | Size | Author |
|---|---|---|---|
| Screenshot of comment-anonymizer | 20.11 KB | wroxbox |
Comments
Comment #1
wroxbox commentedBy removing the '#access' => user_access('comment anonymously when logged in') I got the checkbox printed to form.
Permissions are allowed to authenticated users.
Comment #2
markie commentedI wasn't able to reproduce this on a couple of machines. I would guess that permissions weren't set properly. Please let me know if you are still having a problem with this.
Comment #3
wroxbox commentedOk - found the bug
the permission table is setting permission into "comment anonymously"
so you need to check permissions against that value anon.comment.module line 39
Comment #4
markie commentedGood catch. I have added the change to the dev branch. I'll make a few tests and see if we want to add any changes before adding a new release.
Comment #6
wonder95 commentedIs this going to be fixed? I don't see any commits in the repo other than the initial commit. I can roll a patch if needed.
Comment #7
wonder95 commentedOops, my bad, I see it fixed and committed.
Comment #8
DevJoshLopez commentedI just downloaded and am using the 7.x-1.0 version and I cant see the checkmark under the comment form. What version is this fixed in?
Comment #9
xbl commented2wroxbox: Thx a lot! now it works
215handsmedia: to see checkbox under the comment form you should make changes (comment #3) in line 39 anon_comment.module before the installation of this module (ver. 1.0)