Good afternoon,

I wish I was writing under different circumstances, but I suppose finding these issues is only making og_user_roles that much more robust.

Of course, this may not be an issue and I'm doing something wrong or don't understand how things should be working.

modr8 and og_user_roles seemed to be getting along just fine: when I gave "moderate content" permissions to a role and configured a group member with this og_user_role they were able to check or uncheck "In moderation queue" when editing a group content type.

I recently played with all the available blocks and enabled the "Modr8 moderator's block". This shows up when in group context only for the users that are part of an og_user_role with "moderate content" permissions. As an og-subscribed user with og_user_roles permissions to "moderate content" I thought I would be able to access the link in this block. It doesn't appear to be the case as I get access denied. The link's URL that leads to "access denied" is:

http://foo.bar/kbf/admin/content/modr8

Strangely enough, when I re-"save permissions" in Access Control (not changing anything, just clicking "save permissions" for the heck of it), the site-wide "Moderated Content" and "Content moderation log" links appear, and the user will then have permission to follow those links as well as the link in the "Modr8 moderator's block". But, the user will only be able to view/approve articles that are authored by that user.

Lastly, when viewing a node, a "Moderation" tab appears next to "View" and "Edit". This link never works (always throws "Access denied") even after re-saving permissions as described above in access control.

This might go back to the same issue with og_vocab which is going outside of group context. Can this be fixed like og_vocab or is this a modr8 issue?

Best, Geoff

Comments

SomebodySysop’s picture

Lastly, when viewing a node, a "Moderation" tab appears next to "View" and "Edit". This link never works (always throws "Access denied") even after re-saving permissions as described above in access control.

How do you get the "Moderation" tab on a node view? I don't see one.

http://foo.bar/kbf/admin/content/modr8

This just isn't going to work with OG User Roles for the reasons I have mentioned before.

However, you could create a view that would list the moderated nodes for a group. And, when you click on a node, you would see the "Moderation" tab and be able to change it then. Again, I need some help in seeing that tab because my install of the latest modr8 doesn't seem to display it.

The exported views code below let's you use this url to see all moderated nodes for a group:

http://www.mysite.com/og/modr8/29

  $view = new stdClass();
  $view->name = 'Modr8';
  $view->description = '';
  $view->access = array (
);
  $view->view_args_php = '';
  $view->page = TRUE;
  $view->page_title = 'Nodes in Moderation';
  $view->page_header = '';
  $view->page_header_format = '3';
  $view->page_footer = '';
  $view->page_footer_format = '3';
  $view->page_empty = '';
  $view->page_empty_format = '3';
  $view->page_type = 'table';
  $view->url = 'og/modr8';
  $view->use_pager = TRUE;
  $view->nodes_per_page = '50';
  $view->sort = array (
  );
  $view->argument = array (
    array (
      'type' => 'gid',
      'argdefault' => '1',
      'title' => '%1',
      'options' => '',
      'wildcard' => '',
      'wildcard_substitution' => '',
    ),
  );
  $view->field = array (
    array (
      'tablename' => 'node',
      'field' => 'title',
      'label' => 'Title',
      'handler' => 'views_handler_field_nodelink',
      'sortable' => '1',
      'options' => 'link',
    ),
    array (
      'tablename' => 'node',
      'field' => 'type',
      'label' => 'Type',
      'sortable' => '1',
    ),
    array (
      'tablename' => 'node',
      'field' => 'created',
      'label' => 'Created',
      'handler' => 'views_handler_field_date_small',
      'sortable' => '1',
      'defaultsort' => 'DESC',
    ),
  );
  $view->filter = array (
    array (
      'tablename' => 'node',
      'field' => 'moderate',
      'operator' => '=',
      'options' => '',
      'value' => '1',
    ),
  );
  $view->exposed_filter = array (
  );
  $view->requires = array(node);
  $views[$view->name] = $view;
gmayes’s picture

I don't know how the "Moderation" tab appears, but I do know how I made it disappear: I commented out lines 50-60 of modr8.module. I looked through things some more, and the "Moderation" tab only appears for one article (that's the name of the content type) I have created. I created a new article, page, and even a "test" content type node and none of these articles are showing a "Moderation" tab. I must have done something funky.

Thank you for the views option. I'll look into that shortly.

If you have time, could you give an explanation for dummies why this will never work? I re-read the og_vocab issue and I understand what you say that this link will not work because it's outside of the group context, but then you were able to create a fix for it. I guess that's what I'm confused about: how it was said that it will never work and then you whipped up some magic and made it work. I'm only curious and hoping to understand things better.

Thanks, Geoff

SomebodySysop’s picture

Assigned: Unassigned » SomebodySysop

If you have time, could you give an explanation for dummies why this will never work? I re-read the og_vocab issue and I understand what you say that this link will not work because it's outside of the group context, but then you were able to create a fix for it. I guess that's what I'm confused about: how it was said that it will never work and then you whipped up some magic and made it work. I'm only curious and hoping to understand things better.

This was the og_vocab link in question: http://kb-test.eng.vmware.com/admin/content/taxonomy/edit/term/86?destin...

Note that in this link is a reference to the term. Once we can identify the term, we can identify the group(s) that it belongs to. Once we can do that, we can determine if a user has access to it. Taxonomy has "add term", "list term" and "edit term" functions. og_vocab called the first two functions, then left it to taxonomy to handle the term edit. I simply created a menu callback to call the "edit term" function within a group context.

Now look at this url: http://foo.bar/kbf/admin/content/modr8. This in no way refers to a particular node. When you click on this link, if you have "moderate content" permission, you can access the function. So, if you give a user in Group A the "moderate content" permission, and I allow him to access the modr8 function, he effectively can moderate content for every group on your site. I don't think this is what you want, because if it is, you can simply put the user into a sitewide role that has the "moderate content" permission.

The only way I can help you here is if you can persuade the modr8 maintainer to give you some link or function that can be used to moderate a single node. Something like "function modr8_moderate_node($nid)" or "http://www.mysite.com/node/modr8/$nid". Do this, and now we can limit the "moderate content" permission to just the content within the group(s) the user has access to.

Hopefully, you see the difference in the cases.

gmayes’s picture

Thank you for clarifying what the issue is here. I now understand.

SomebodySysop’s picture

Status: Active » Fixed

Release 2.1 of OG User Roles now modified to work with modr8 module.

If a user has an OG role which gives him the "moderate content" permission, this user can NOT access the moderation list or overall moderation log. These are "admin" functions and OG User Roles does not give group role users access to sitewide "admin" functions. However, the user CAN moderate individual nodes (a "Moderate" tab will appear on nodes that the user can moderate) and see the moderation log for individual nodes.

Because the OG user can see individual nodes in a group that he is able to moderate and in fact is able to moderate those individual nodes, we can use "Views" to obtain a list of nodes in moderation. I exported a view here: http://drupal.org/node/164092#comment-283138 to list all nodes in moderation for a particular group. The URL to the view is: http://www.mysite.com/og/modr8/. The user can now use this view to list all nodes in moderation within a group, click on the node link which will bring it up with a "Moderate" tab, and then click on the tab to change the moderation status of the node.

SomebodySysop’s picture

Status: Fixed » Closed (fixed)

Release 2.1 now available for download.

jenyum’s picture

Status: Closed (fixed) » Needs review

deleted

jenyum’s picture

Status: Needs review » Closed (fixed)
jenyum’s picture

Status: Closed (fixed) » Needs review

I set up a site last week with the latest stable releases of OG, Modr8, and OG User Roles. I did not see any "Moderate" tab or any way to set one up. Since the last posts here were from 2007, something may have changed in the interim.

Anyway, to make things clear to my group admins I created a block that appears on all pages of the groups they administer, with a list of posts in the moderation queue. (You can set a limit, and a pager so the list won't be ridiculously long if the group is very active.)

If this doesn't work for you, try cloning the "og_files" block view, changing the field to "node-title" and adding an "moderated - yes" filter. Then add group validation to your group argument, checking to see if the user is an admin. This view was exported from Views 2 and Drupal 6. Can't guarantee everything will work for your particular set up.

$view = new view;
$view->name = 'og_moderatelink';
$view->description = 'Moderation Link for Group Admins';
$view->tag = 'og';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
  'title' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'link_to_node' => 1,
    'exclude' => 0,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('sorts', array(
  'changed' => array(
    'order' => 'DESC',
    'granularity' => 'second',
    'id' => 'changed',
    'table' => 'node',
    'field' => 'changed',
    'relationship' => 'none',
  ),
));
$handler->override_option('arguments', array(
  'group_nid' => array(
    'default_action' => 'default',
    'style_plugin' => 'default_summary',
    'style_options' => array(),
    'wildcard' => 'all',
    'wildcard_substitution' => 'All',
    'title' => '',
    'breadcrumb' => '',
    'default_argument_type' => 'og_group_node',
    'default_argument' => '',
    'validate_type' => 'og_group_types',
    'validate_fail' => 'not found',
    'break_phrase' => 0,
    'not' => 0,
    'id' => 'group_nid',
    'table' => 'og_ancestry',
    'field' => 'group_nid',
    'relationship' => 'none',
    'default_options_div_prefix' => '',
    'default_argument_user' => 0,
    'default_argument_fixed' => '',
    'default_argument_php' => 'if ($node = og_get_group_context()) {
                return $node->nid;
              }
              else {
                return NULL;
              }',
    'validate_argument_node_type' => array(
      'webform' => 0,
      'article' => 0,
      'front' => 0,
      'front_content' => 0,
      'granite_color' => 0,
      'group_photo' => 0,
      'guest_book' => 0,
      'memories' => 0,
      'monument' => 0,
      'page' => 0,
      'photo_memories' => 0,
      'remember_me' => 0,
      'story' => 0,
    ),
    'validate_argument_node_access' => 0,
    'validate_argument_nid_type' => 'nid',
    'validate_argument_vocabulary' => array(
      '2' => 0,
      '1' => 0,
    ),
    'validate_argument_type' => 'tid',
    'validate_argument_is_member' => 'OG_VIEWS_VALIDATE_GROUP_ADMIN',
    'validate_argument_php' => '',
    'validate_user_argument_type' => 'uid',
    'validate_user_roles' => array(
      '2' => 0,
      '8' => 0,
      '6' => 0,
      '4' => 0,
      '5' => 0,
      '7' => 0,
      '3' => 0,
    ),
    'override' => array(
      'button' => 'Override',
    ),
    'validate_argument_transform' => 0,
    'validate_user_restrict_roles' => 0,
    'validate_argument_group_node_type' => array(
      'remember_me' => 0,
    ),
  ),
));
$handler->override_option('filters', array(
  'moderate' => array(
    'operator' => '=',
    'value' => '1',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'moderate',
    'table' => 'node',
    'field' => 'moderate',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
  'role' => array(),
  'perm' => '',
));
$handler->override_option('cache', array(
  'type' => 'none',
));
$handler->override_option('title', 'Posts In Moderation');
$handler->override_option('use_pager', 'mini');
$handler->override_option('style_plugin', 'list');
$handler->override_option('style_options', array(
  'grouping' => '',
  'type' => 'ul',
));
$handler = $view->new_display('block', 'Block', 'block_1');
$handler->override_option('block_description', 'In Moderation');
$handler->override_option('block_caching', -1);

Since it doesn't look like OG Modr8 is ever going to be revived, it would be nice if Modr8 or OG came with a pre-set "OG Moderate" block. Would save a ton of work hunting these issues down.

sun’s picture

Status: Needs review » Closed (fixed)

Drupal 5 is globally, unconditionally, and officially unsupported since Jan 7th, 2011 - the release of Drupal 7. You are encouraged to upgrade to Drupal 6, or even better, Drupal 7.

Reverting issue status.

jenyum’s picture

Version: 5.x-2.0 » 6.x-4.1
Status: Closed (fixed) » Needs review

I didn't notice the Drupal 5 status when I wrote my last post, I'm running Drupal 6 on the site where I encountered no clear out of the box way to moderate, no moderation tab.