Skip to:
Content
Pages
Categories
Search
Top
Bottom

Moderator cannot assign tags

  • @oliver_rub

    Participant

    Hey guys,
    i have the problem that moderators in my forum can assign/modify tags at all. According to the bbPress role they should be able to do so. The template checks whether tags are allowed (which is true, since normal users (=participants) and admins can successfully post tags). I tried to fix it with the following code:

    function rub_fix_moderator_tags_capability($allcaps, $caps, $args){
    
    	if($args[0] !== 'assign_topic_tags'){
    		return $allcaps;
    	}
    
    	if(bbp_group_is_mod()){
    		$allcaps['manage_topic_tags'] = 1;
    		$allcaps['edit_topic_tags'] = 1;
    		$allcaps['delete_topic_tags'] = 1;
    		$allcaps['assign_topic_tags'] = 1;
    	}
    
    	return $allcaps;
    }
    add_filter('user_has_cap', 'rub_fix_moderator_tags_capability', 10, 3);

    Not sure whether this approach is correct, since it doesnt solve my problem 😉 Also when i try something like echo current_user_can('assign_topic_tags'); in there as a check, the page doenst load anymore.
    But also I´m a little bit clueless in terms of where to look for a solution. I created a somewhat clean install (just copied over the files, but new db) using the twentyfifteen theme, and there moderators are also not able to post tags. In terms of plugins I only have BuddyPress and bbPress enabled.
    Has someone an idea where to start looking or how to approach this?

Viewing 4 replies - 1 through 4 (of 4 total)
  • @oliver_rub

    Participant

    *bump* (since i cant edit the topic)

    @robkk

    Moderator

    Can you assign topic tags in a regular forum?
    Can you assign topic tags in a group forum?
    Have you tried creating custom roles?
    Have you installed a user role editing plugin?
    Have you ran any repair tools in Tools > Forums yet, especially the Remap existing users to default forum roles one?

    Have you tried most of the basic troubleshooting steps already?

    Troubleshooting

    @oliver_rub

    Participant

    Hi @robkk
    (somehow i managed to unsubscribe from my own topic…thus the delayed response). Thanks for your answer.
    My forums are intended to be group forums for buddypress. And this is also the case in which I have this bug.
    So in regular forums a user who has the overall moderator priviledge (set in user settings) can set tags. Works as expected.
    In the case where a user has overall participant priviledges and I set a user in the group management setting (I suppose thats BuddyPress) to be moderator, then the user cant assign tags anymore although he could as a normal member. This is the behaviour I would consider a bug 😉
    No I havent tried creating custom roles. I´m also not sure about the interaction with BuddyPress, thus I tried to get some help here first.
    On my regular installation I have a role editing plugin, but not on the new test platform. Thus I would discard this as a cause for the bug.
    I just ran the repair feature which updated 1 user on the test platform, but this didnt affect the priviledge to post tags. It just resets the overall moderator role of a person to normal participant (if the user has a WordPress subscriber role).

    Regerding the other trouble shooting:
    – Its a fresh installation
    – With 2015 theme
    – Only bbPress & BuddyPress as plugins
    – I just ran the repair functions again, since this is a fresh install nothing has been updated according to the notifications from the repair functions.

    I´m aware that this seems to be an issue between bbPress & BuddyPress and I´m not sure which plugin causes this bug. Since bbPress tags are disappearing I thought it might be bbPress.
    Any further ideas how to approach this?

    @ssebech

    Participant

    I am experiencing exactly the same problem. BP Group Moderators do have capabilities like edit, close, merge, split topics or replies in the Group Forum but they do not see the textbox to assign or edit tags. I tried to show the box by hacking the files
    /wp-content/plugins/bbpress/templates/default/bbpress/form-topic.php
    and
    /wp-content/plugins/bbpress/templates/default/bbpress/form-reply.php
    by removing the condition “&& ( current_user_can( ‘assign_topic_tags’ )”
    but then the tags assigned in the box have not been saved, anyway.
    There must be a bug in the capabilities mapping from BP group moderator to bbP forum moderator. The capabilities like ‘assign_topic_tags’, ‘edit_topic_tags’, etc. are missing there.
    For BP group admins and ordinary members it works well, they can assign and edit topic tags in their group forum.
    But where is the code of this mapping? I cannot find it.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar