• Using BP wiki 1.0.2 (Jan 10, 2011) I have the issue that the Wiki sub-nav is only displayed for admin users, not for other users (even if everything is set to public). Also, only admin users can access wiki entries, others are redirected to the home page when following such a link.

    I scanned the code a bit (without understanding it much – I am not a PHP programmer…) and found a band-aid brute force solution by modifying “bp-wiki-core.php” in the following way:

    function wiki_nav_for_private_groups() {
    			global $bp;
    
    			if ( $bp->current_component == $bp->groups->slug && $bp->is_single_item ) {
    				wp_enqueue_script( 'tiny_mce' );
    				/**
    					olafdruemmer - 2011-01-19
    					added "true ||" in the line below to always make the rest of the if statement happen
    					as otherwise only admins can access the wiki; not sure why this seemingly is broken....
    				**/
    				if ( true || $bp->groups->current_group->status == 'private' && groups_get_groupmeta( $bp->groups->current_group->id, 'bp_wiki_group_wiki_enabled' ) == true )  {
    					if ( groups_get_groupmeta( $bp->groups->current_group->id, 'bp_wiki_group_wiki_enabled' ) == 'yes' ) {
    						bp_core_new_subnav_item( array( 'name' => ( !$this->nav_item_name ) ? $this->name : $this->nav_item_name, 'slug' => $this->slug, 'parent_slug' => BP_GROUPS_SLUG, 'parent_url' => bp_get_group_permalink( $bp->groups->current_group ) . '/', 'position' => $this->nav_item_position, 'item_css_id' => 'nav-' . $this->slug, 'screen_function' => array( &$this, '_display_hook' ), 'user_has_access' => $this->enable_nav_item ) );
    					}
    				}
    			}
    		}

    Please do not laugh at me for the approach, I do know it is a very bad hack. But for now it resolves the issue for me as in my Buddypress setup everyone is allowed to see all wikis anyway.

    It would be nice if a next version could address this problem though… (or if I am missing a point here, I’d like to be enlightened accordingly).

    Apart from that – thanks a thousand times for the really cool plugin.

    Olaf

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: BuddyPress Wiki Component] Wiki sub-nav showing for admin but not for others’ is closed to new replies.