[buddypress-trac] [BuddyPress] #4586: stops loading tabs after

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Mon Oct 8 18:54:36 UTC 2012


#4586: stops loading tabs after
--------------------------+-----------------------------
 Reporter:  smninja       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Groups        |    Version:  1.6.1
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 bp_register_group_extension appears to stop registering tabs after the
 current one is selected in "Admin" under Groups.

 '''Test case:'''
 1. Enable plugin
 2. Navigate to a group page, "Admin > Test 3"
 3. Click "Test 2", then "Test"

 '''Expected Result:'''
 All tabs should continue to display.

 '''Actual Result:'''
 Tabs disappear as you click backwards through "Test 3" > "Test 2" > "Test"

 '''Plugin Test Code'''
 {{{
 <?php
 /**
 Plugin Name: BuddyPress Groups Test Tab
 Description: Test case for a bug. When using the Admin subnav, select
 "Test" and "Test 2" will disappear
 Version: 0.6
 Author: Tyler Mulligan
 **/

 function bptt_init() {

     class Groups_Test_Tab extends BP_Group_Extension {

         var $visibility = 'public'; // 'public' will show your extension
 to non-group members, 'private' means you have to be a member of the group
 to view your extension.

         var $enable_create_step = false; // If your extension does not
 need a creation step, set this to false
         var $enable_nav_item = true; // If your extension does not need a
 navigation item, set this to false
         var $enable_edit_item = true; // If your extension does not need
 an edit screen, set this to false

         function Groups_Test_Tab() {
             $this->name = "Test";
             $this->slug = "test";
             $this->create_step_position = 21;
             $this->nav_item_position = 31;
         }

         function display() {
             echo "test";
         }

         function edit_screen() {
             echo "test";
         }
     }

     class Groups_Test_Tab2 extends BP_Group_Extension {

         var $visibility = 'public'; // 'public' will show your extension
 to non-group members, 'private' means you have to be a member of the group
 to view your extension.

         var $enable_create_step = false; // If your extension does not
 need a creation step, set this to false
         var $enable_nav_item = true; // If your extension does not need a
 navigation item, set this to false
         var $enable_edit_item = true; // If your extension does not need
 an edit screen, set this to false

         function Groups_Test_Tab2() {
             $this->name = "Test 2";
             $this->slug = "test2";
             $this->create_step_position = 22;
             $this->nav_item_position = 32;
         }

         function display() {
             echo "test 2";
         }

         function edit_screen() {
             echo "Test 2";
         }
     }

     class Groups_Test_Tab3 extends BP_Group_Extension {

         var $visibility = 'public'; // 'public' will show your extension
 to non-group members, 'private' means you have to be a member of the group
 to view your extension.

         var $enable_create_step = false; // If your extension does not
 need a creation step, set this to false
         var $enable_nav_item = true; // If your extension does not need a
 navigation item, set this to false
         var $enable_edit_item = true; // If your extension does not need
 an edit screen, set this to false

         function Groups_Test_Tab3() {
             $this->name = "Test 3";
             $this->slug = "test3";
             $this->create_step_position = 23;
             $this->nav_item_position = 33;
         }

         function display() {
             echo "test 3";
         }

         function edit_screen() {
             echo "Test 3";
         }
     }

     bp_register_group_extension( 'Groups_Test_Tab' );
     bp_register_group_extension( 'Groups_Test_Tab2' );
     bp_register_group_extension( 'Groups_Test_Tab3' );

 }

 add_action( 'bp_include', 'bptt_init' );

 ?>
    $this->create_step_position = 22;
             $this->nav_item_position = 32;
         }

         function display() {
             echo "test 3";
         }

         function edit_screen() {
             echo "Test 3";
         }
     }

     bp_register_group_extension( 'Groups_Test_Tab' );
     bp_register_group_extension( 'Groups_Test_Tab2' );
     bp_register_group_extension( 'Groups_Test_Tab3' );

 }

 add_action( 'bp_include', 'bptt_init' );

 ?>
 }}}

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


More information about the buddypress-trac mailing list