[buddypress-trac] [BuddyPress Trac] #9103: Forum Link in Group-Nav even when enable_forum=false

buddypress-trac noreply at wordpress.org
Tue Feb 20 14:08:36 UTC 2024


#9103: Forum Link in Group-Nav even when enable_forum=false
--------------------------+--------------------
 Reporter:  bigbozo       |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  12.3.0
Component:  Groups        |    Version:  12.2.0
 Severity:  minor         |   Keywords:
--------------------------+--------------------
 We found that a group despite having no forum attached shows a link to
 forum nonetheless.
 When called The title of an random? existing forum is displayed,
 interaction is not possible.

 We circumvented the problem by writing a childtemplate for `wp-
 content/plugins/buddypress/bp-templates/bp-
 nouveau/buddypress/groups/single/parts/item-nav.php` checking if a forum
 is attached and subsequently suppressing the link-output.

 {{{#!php
 <?php
 ...
         while ( bp_nouveau_nav_items()) :
                 bp_nouveau_nav_item();
                         ?>
                 <?php
                 /**
                  * Patch to suppress link to forum if not exist
                  */
                         if ('bp_group_read_forum' ===
 bp_nouveau()->current_nav_item['rewrite_id'] &&
                             false ==
 buddypress()->groups->current_group->enable_forum) {
                             continue;
                         }
                 ?>
 ...
 }}}

 After intensive debugging we found that when
 `\BBP_Forums_Group_Extension::maybe_unset_forum_menu` is called
 `bp_is_group()` returns `false`.

 Later the line `\BP_Groups_Component::parse_query:1074` gets executed;
 after that `bp_is_group()` correctly returns `true`.

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/9103>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list