Despite of Configuring correctly to post Anonymous Nodes for different Content Types, when I try to post Anonymous Nodes of those content types, i can't get the options available to do Anonymous posts, that problem is similar for nodecomments.

Comments

dannymontalvo’s picture

StatusFileSize
new1.62 KB

The problem were found on the helper function anonymizer_access, there are two variables used to store the configuration: for posting nodes( anonymizer_node_types ) and for nodecomments (anonymizer_nodecomment_types). What were needed to fix is the use of this variables on that helper function, seems to be mixed when were coded.

Cheers,

calefilm’s picture

Thank you so much dannymontalvo! Confirmed this works. This is your same code, but I'm adding the line numbers just in case someone can benefit.

Go to folder: sites/all/anonymizer/anonymizer.module

Delete lines: 310 - 335 " starting at function anonymizer_access($action, $node = NULL) { "
replace with:

function anonymizer_access($action, $node = NULL) {
  
   switch ($action) {
     case 'view':
       return user_access('administer anonymizer') || user_access('view hidden author');
       break;
     case 'post':
      $types = variable_get('anonymizer_node_types', array());

       if (module_exists('nodecomment')) {
         // If NodeComment enabled for given content type AND If
         // anonymizer enabled
         if (isset($node->comment_target_nid)) {
           $parent = node_load($node->comment_target_nid);
           $types = variable_get('anonymizer_nodecomment_types', array());
           if (isset($types[$parent->type])) {
             return user_access('administer anonymizer') || user_access('post anonymous comments');
           }
         }
         // If posting a node
         elseif (in_array($node->type, $types)) {
           return user_access('administer anonymizer') || user_access('post anonymous nodes');
         }
       }
       // If posting a node
       elseif (in_array($node->type, $types)) {
         return user_access('administer anonymizer') || user_access('post anonymous nodes');
       }
       break;  }

calefilm’s picture

TURN ON 'Post Anonymously' by default

Change:

      $set_anon = (anonymizer_author($form['nid']['#value']) !== FALSE);

To:

      $set_anon = (anonymizer_author($form['nid']['#value']) !== TRUE);
spivey’s picture

Has any more work been done on this? I tried these steps out but I cannot get anonymous comments to work. Not only for roles but the site admin cannot post anonymously.

calefilm’s picture

True True. I did not need them for comments but can see what you're talking about. Would be nice to find a solution to that.

gaele’s picture

StatusFileSize
new1.62 KB

Same patch as #1 with correct filename inside patch.

gaele’s picture

gaele’s picture

Status: Active » Reviewed & tested by the community

Patch works.

develcuy’s picture

Status: Reviewed & tested by the community » Needs work

@gaele, own RTBC is a bad practice ;)

develcuy’s picture

Status: Needs work » Fixed

Committed to DRUPAL-6--2

Status: Fixed » Closed (fixed)

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