I seem to have lost the ability for set moderators to lock topics by altering the comment settings. Edit and Delete options are available and work as expected, however the Vertical Tabs List with the comment settings options is not visible.

I've also installed Devel and enabled DNA but it's not outputting anything (and I have enabled the block for it). This is another issue though and may/may not be related.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

KarinG’s picture

lost the ability

When did this happen?

What configuration screen - exactly - are you looking at?

salvis’s picture

Status: Active » Postponed (maintainer needs more info)

Please provide the path as well as before and after screenshots.

shane1090’s picture

After a bit of tinkering around I managed to get Devel working, and it was showing that the moderator had all the correct permissions to modify the node, however the vertical tabs with further options still were not visible. Looking into the code, I found it to be a problem with the _forum_access_node_form() function in forum_access.node.inc.

This may not be where the bug is originating from, but it's where I made a couple of tweaks to fix it on my installation.

In my case, the part of this function that applys modifications for moderators didn't seem to be adding options for the stickys, comment settings and revision. To make this available, I need to modify the switch statement to add in a few more variables:

Original Switch statement:

switch ($key) {
  case 'buttons':
  $tid = $form['taxonomy'][$vid]['#default_value'][0];
    if (!forum_access_access('update', $tid)) {
    	$form['buttons']['submit']['#access'] = FALSE;
      $form['buttons']['preview']['#access'] = FALSE;
    }
    if (!forum_access_access('delete', $tid)) {
    	$form['buttons']['delete']['#access'] = FALSE;
    }
    break;
	case 'author':
   	$form['author']['#disabled'] = TRUE;
    break;
  case 'options':
    foreach (element_children($form['options']) as $key2) {
    	if (array_search($key2, $allowed_options) === FALSE) {
      	$form['options'][$key2]['#access'] = FALSE;
     	}
   	}
    break;
 	case 'shadow':
  	$form['shadow']['#description'] .= '<br />' . t('Note: Access to this topic and its shadows is controlled by the forum that contains the topic.');
   	break;
 	case 'taxonomy_forums':
  	$desc =& $form['taxonomy_forums'][$form['taxonomy_forums']['#language']]['#description'];
   	if (!empty($desc)) {
    	$desc .= '<br />';
   	}
    $desc .= t('Note: Moving a topic to a different forum may change its accessibility.');
}

Modified Switch code:

switch ($key) {
  case 'buttons':
  $tid = $form['taxonomy'][$vid]['#default_value'][0];
    if (!forum_access_access('update', $tid)) {
    	$form['buttons']['submit']['#access'] = FALSE;
      $form['buttons']['preview']['#access'] = FALSE;
    }
    if (!forum_access_access('delete', $tid)) {
    	$form['buttons']['delete']['#access'] = FALSE;
    }
    break;
 	case 'author':
  	$form['author']['#disabled'] = TRUE;
    break;
 	case 'options':
  	foreach (element_children($form['options']) as $key2) {
    	if (array_search($key2, $allowed_options) === FALSE) {
      	$form['options'][$key2]['#access'] = FALSE;
     	}
   	}
    $form['options']['#access'] = 1;
    break;
 	case 'revision_information':
  	$form['revision_information']['#access'] = 1; 
		break;
 	case 'comment_settings':
  	$form['comment_settings']['#access'] = 1; 
    break;
 	case 'shadow':
  	$form['shadow']['#description'] .= '<br />' . t('Note: Access to this topic and its shadows is controlled by the forum that contains the topic.');
    break;
 	case 'taxonomy_forums':
  	$desc =& $form['taxonomy_forums'][$form['taxonomy_forums']['#language']]['#description'];
  	if (!empty($desc)) {
    	$desc .= '<br />';
    }
    $desc .= t('Note: Moving a topic to a different forum may change its accessibility.');
}

Notice the additional 'case' additions for 'revision information' and 'comment_settings' and also the additional line after the foreach loop in the 'options' case. Making these additions enabled it to work as I would expect it to.

I've also tested this with a bare minimum installation as well and it's showing the same problem - no way to modify the options above as a moderator.

salvis’s picture

Sorry, we're not communicating. I still don't know what the problem is that you're trying to fix.

1. Provide the path (URL) where the problem occurs
2. Report according to
a) what you did
b) what you expected to happen
c) what happened instead
3. Provide screenshots of the faulty display and the healthy one.
4. Finally, please provide your changes as a patch and set the status to NR, so that the testbot will look at it.

salvis’s picture

Status: Postponed (maintainer needs more info) » Needs review
FileSize
3.44 KB

Ok, found it now.

Let's try this...

Status: Needs review » Needs work

The last submitted patch, forum_access.moderator_node_properties.1701504.5.patch, failed testing.

salvis’s picture

Status: Needs work » Needs review
FileSize
3.44 KB

Hmm, weird, no details link, and no retry link either.

Retry...

Status: Needs review » Needs work

The last submitted patch, forum_access.moderator_node_properties.1701504.5.patch, failed testing.

salvis’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Status: Needs work » Needs review
FileSize
3.44 KB

Three times...

Status: Needs review » Needs work

The last submitted patch, forum_access.moderator_node_properties.1701504.5.patch, failed testing.

salvis’s picture

Status: Needs work » Needs review
FileSize
3.52 KB

Updated patch.

Status: Needs review » Needs work

The last submitted patch, forum_access.moderator_node_properties.1701504.11.patch, failed testing.

salvis’s picture

Status: Needs work » Needs review
FileSize
3.05 KB

Same patch again after rfay has fixed the testbot: #1768442: Testbot fails to get dependency after adding a version number

Status: Needs review » Needs work

The last submitted patch, forum_access.moderator_node_properties.1701504.13.patch, failed testing.

salvis’s picture

Status: Needs work » Needs review
FileSize
2.97 KB

We'll get there eventually...

salvis’s picture

Status: Needs review » Fixed

There!

Committed to the -dev version.

Status: Fixed » Closed (fixed)

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