[buddypress-trac] [BuddyPress] #5012: bp_nav_menu() function problems

buddypress-trac noreply at wordpress.org
Sun May 19 12:10:53 UTC 2013


#5012: bp_nav_menu() function problems
---------------------------+-----------------------------
 Reporter:  therearwindow  |      Owner:
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Core           |    Version:  1.7
 Severity:  normal         |   Keywords:
---------------------------+-----------------------------
 WP (latest version) & BP (1.7.2) Fresh installation.

 Here is the problem with bp_nav_menu()

 Default menu for admin user:

 <div class="menu-bp-container"><ul id="menu-bp" class="menu"><li id
 ="activity-personal-li"><a href="http://activity/">Activity</a>
 <ul class="sub-menu">
         <li id="just-me-personal-li"><a
 href="http://example.com/wp2/members/admin/activity/">Personal</a></li>
         <li id="activity-mentions-personal-li"><a
 href="http://example.com/wp2/members/admin/activity/mentions/">Mentions</a></li>
         <li id="activity-favs-personal-li"><a
 href="http://example.com/wp2/members/admin/activity/favorites/">Favorites</a></li>
         <li id="activity-friends-personal-li"><a
 href="http://example.com/wp2/members/admin/activity/friends/">Friends</a></li>
         <li id="activity-groups-personal-li"><a
 href="http://example.com/wp2/members/admin/activity/groups/">Groups</a></li>
 </ul>
 </li>
 <li id="xprofile-personal-li"><a href="http://profile/">Profile</a>
 <ul class="sub-menu">
         <li id="public-personal-li"><a
 href="http://example.com/wp2/members/admin/profile/">View</a></li>
         <li id="edit-personal-li"><a
 href="http://example.com/wp2/members/admin/profile/edit/">Edit</a></li>
         <li id="change-avatar-personal-li"><a
 href="http://example.com/wp2/members/admin/profile/change-avatar/">Change
 Avatar</a></li>
 </ul>
 </li>
 <li id="messages-personal-li"><a href="http://messages/">Messages
 <span>0</span></a>
 <ul class="sub-menu">
         <li id="inbox-personal-li"><a
 href="http://example.com/wp2/members/admin/messages/">Inbox</a></li>
         <li id="sentbox-personal-li"><a
 href="http://example.com/wp2/members/admin/messages/sentbox/">Sent</a></li>
         <li id="compose-personal-li"><a
 href="http://example.com/wp2/members/admin/messages/compose/">Compose</a></li>
         <li id="notices-personal-li"><a
 href="http://example.com/wp2/members/admin/messages/notices/">Notices</a></li>
 </ul>
 </li>
 <li id="friends-personal-li"><a href="http://friends/">Friends
 <span>0</span></a>
 <ul class="sub-menu">
         <li id="friends-my-friends-personal-li"><a
 href="http://example.com/wp2/members/admin/friends/">Friendships</a></li>
         <li id="requests-personal-li"><a
 href="http://example.com/wp2/members/admin/friends/requests/">Requests</a></li>
 </ul>
 </li>
 <li id="groups-personal-li"><a href="http://groups/">Groups
 <span>0</span></a>
 <ul class="sub-menu">
         <li id="groups-my-groups-personal-li"><a
 href="http://example.com/wp2/members/admin/groups/">Memberships</a></li>
         <li id="invites-personal-li"><a
 href="http://example.com/wp2/members/admin/groups/invites/">Invitations</a></li>
 </ul>
 </li>
 <li id="settings-personal-li"><a href="http://settings/">Settings</a>
 <ul class="sub-menu">
         <li id="general-personal-li"><a
 href="http://example.com/wp2/members/admin/settings/">General</a></li>
         <li id="notifications-personal-li"><a
 href="http://example.com/wp2/members/admin/settings/notifications/">Notifications</a></li>
         <li id="capabilities-personal-li"><a
 href="http://example.com/wp2/members/admin/settings/capabilities/">Capabilities</a></li>
 </ul>
 </li>
 </ul></div>



 Default menu for normal user:

 <div class="menu-bp-container"><ul class="menu" id="menu-bp"><li id
 ="activity-personal-li"><a href="http://activity/">Activity</a>
 <ul class="sub-menu">
         <li id="just-me-personal-li"><a
 href="http://example.com/wp2/members/antton/activity/">Personal</a></li>
         <li id="activity-mentions-personal-li"><a
 href="http://example.com/wp2/members/antton/activity/mentions/">Mentions</a></li>
         <li id="activity-favs-personal-li"><a
 href="http://example.com/wp2/members/antton/activity/favorites/">Favorites</a></li>
         <li id="activity-friends-personal-li"><a
 href="http://example.com/wp2/members/antton/activity/friends/">Friends</a></li>
         <li id="activity-groups-personal-li"><a
 href="http://example.com/wp2/members/antton/activity/groups/">Groups</a></li>
 </ul>
 </li>
 <li id="xprofile-personal-li"><a href="http://profile/">Profile</a>
 <ul class="sub-menu">
         <li id="public-personal-li"><a
 href="http://example.com/wp2/members/antton/profile/">View</a></li>
 </ul>
 </li>
 <li id="friends-personal-li"><a href="http://friends/">Friends
 <span>0</span></a>
 <ul class="sub-menu">
         <li id="friends-my-friends-personal-li"><a
 href="http://example.com/wp2/members/antton/friends/">Friendships</a></li>
 </ul>
 </li>
 <li id="groups-personal-li"><a href="http://groups/">Groups
 <span>0</span></a>
 <ul class="sub-menu">
         <li id="groups-my-groups-personal-li"><a
 href="http://example.com/wp2/members/antton/groups/">Memberships</a></li>
 </ul>
 </li>
 </ul></div>



 Default menu inside a group created by normal user:
 http://example.com/wp2/groups/example_group/

 <div class="menu-bp-container">
 <ul class="menu" id="menu-bp">
 <li id="groups-personal-li"><a
 href="http://example_group/">Memberships</a>
 <ul class="sub-menu">
         <li id="groups-my-groups-personal-li"><a
 href="http://example.com/wp2/members/antton/groups/">Memberships</a></li>
 </ul>
 </li>
 <li id="activity-personal-li"><a href="http://activity/">Activity</a>
 <ul class="sub-menu">
         <li id="just-me-personal-li"><a
 href="http://example.com/wp2/members/antton/activity/">Personal</a></li>
         <li id="activity-mentions-personal-li"><a
 href="http://example.com/wp2/members/antton/activity/mentions/">Mentions</a></li>
         <li id="activity-favs-personal-li"><a
 href="http://example.com/wp2/members/antton/activity/favorites/">Favorites</a></li>
         <li id="activity-friends-personal-li"><a
 href="http://example.com/wp2/members/antton/activity/friends/">Friends</a></li>
         <li id="activity-groups-personal-li"><a
 href="http://example.com/wp2/members/antton/activity/groups/">Groups</a></li>
 </ul>
 </li>
 <li id="xprofile-personal-li"><a href="http://profile/">Profile</a>
 <ul class="sub-menu">
         <li id="public-personal-li"><a
 href="http://example.com/wp2/members/antton/profile/">View</a></li>
 </ul>
 </li>
 <li id="friends-personal-li"><a href="http://friends/">Friends
 <span>0</span></a>
 <ul class="sub-menu">
         <li id="friends-my-friends-personal-li"><a
 href="http://example.com/wp2/members/antton/friends/">Friendships</a></li>
 </ul>
 </li>
 <li id="groups-personal-li"><a href="http://groups/">Groups
 <span>1</span></a></li>
 <li class="current-menu-item" id="home-personal-li"><a
 href="http://example.com/wp2/groups/example_group/">Home</a></li>
 <li id="members-personal-li"><a
 href="http://example.com/wp2/groups/example_group/members/">Members
 <span>1</span></a></li>
 <li id="invite-personal-li"><a
 href="http://example.com/wp2/groups/example_group/send-invites/">Send
 Invites</a></li>
 <li id="admin-personal-li"><a
 href="http://example.com/wp2/groups/example_group/admin/">Admin</a></li>
 </ul></div>


 As you can see the top level URLs are broken. Also groups-personal-li id
 is used twice, and I really can't appreciate the difference between
 Memberships or Groups Top levels, there are more problems as you can see
 that the Messages Top level menu disappear, and except the submenus of the
 TopLevel Activity the others doesn't have all their sub-menus.

 About the submenus html structure of the groups submenu It's quite obvious
 that we need to rewrite.


 I found a 'solution' about missing submenu items, but I'm not sure if it's
 gonna be soo good. Change the following function the menu works properly.
 Messages toplevel appear and load all submenu items as well.


 function bp_core_can_edit_settings() {
         if ( bp_is_my_profile() )
                 return true;

         //if ( bp_current_user_can( 'bp_moderate' ) || current_user_can(
 'edit_users' ) )
         if ( bp_current_user_can( 'bp_moderate' ) || !current_user_can(
 'edit_users' ) )  // Maybe I'm opening a new bug :(
                 return true;

         return false;
 }

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


More information about the buddypress-trac mailing list