[buddypress-trac] [BuddyPress Trac] #9052: Duplicate "page on front" option values when BP Classic Add-on is activated

buddypress-trac noreply at wordpress.org
Mon Jan 1 15:17:45 UTC 2024


#9052: Duplicate "page on front" option values when BP Classic Add-on is activated
--------------------------+---------------------------------------
 Reporter:  emaralive     |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Core          |    Version:  12.0.0
 Severity:  normal        |   Keywords:  has-patch has-screenshots
--------------------------+---------------------------------------
 == Environment

 **WordPress:**
 Version: 6.5-alpha-57235

 **Parent Theme:**
 Name   : Twenty Eleven (twentyeleven)
 Version: 4.5

 **Server:**
 PHP version: 7.4.33 (Supports 64bit values)

 **BuddyPress:**
 Version             : 14.0.0-alpha
 Active components   : Community Members, Extended Profiles, Account
 Settings, Friend Connections, Private Messaging, Activity Streams,
 Notifications, User Groups, Site Tracking
 Active template pack: BuddyPress Nouveau 14.0.0-alpha
 URL Parser          : Legacy Parser (used to illustrate issue [2nd
 result], to test patch and illustrate final (3rd) result)
 URL Parser          : BP Rewrites API (used to illustrate 1st result and
 to test patch)


 ----


 The issue can be seen by having the **BP Classic** Add-on **activated**
 and viewing either the "**Reading Settings**" screen (**Dashboard >
 Settings > Reading**) or the "**Homepage Settings**" panel in
 **Customizer** (**Dashboard > Appearance > Customize > Homepage
 Settings**) and then click the "**static page**" radio button and then
 click the "**Hompage**" dropdown box. However, the following is the option
 values with the **BP Classic** Add-on **deactivated** (see screenshot w/o
 patch BP Classic deactivated):


 {{{
 wp_dropdown_pages(array('name' => 'page_on_front','echo' =>
 0,'show_option_none' => __( '— Select —' ),'option_none_value'
 => '0','selected' => get_option( 'page_on_front' ),))
 => string(375) "<select name='page_on_front' id='page_on_front'>
         <option value="0">— Select —</option>
         <option class="level-0" value="45">Activity</option>
         <option class="level-0" value="55">Blog</option>
         <option class="level-0" value="49">Groups</option>
         <option class="level-0" value="47">Members</option>
         <option class="level-0" value="2">Sample Page</option>
 </select>
 }}}


 The following is when the **BP Classic** Add-on is **activated**, notice
 that **Activity**, **Groups** and **Members** option values are
 **duplicated** (see screenshot w/o patch BP Classic activated):


 {{{
 wp_dropdown_pages(array('name' => 'page_on_front','echo' =>
 0,'show_option_none' => __( '— Select —' ),'option_none_value'
 => '0','selected' => get_option( 'page_on_front' ),))
 => string(642) "<select name='page_on_front' id='page_on_front'>
         <option value="0">— Select —</option>
         <option class="level-0" value="51">Activate</option>
         <option class="level-0" value="45">Activity</option>
         <option class="level-0" value="45">Activity</option>
         <option class="level-0" value="55">Blog</option>
         <option class="level-0" value="49">Groups</option>
         <option class="level-0" value="49">Groups</option>
         <option class="level-0" value="47">Members</option>
         <option class="level-0" value="47">Members</option>
         <option class="level-0" value="53">Register</option>
         <option class="level-0" value="2">Sample Page</option>
 </select>
 }}}


 Finally, with patch applied and the **BP Classic** Add-on **activated**,
 the option values are what should have been initially expected (see
 screenshot w/ patch BP Classic activated)):


 {{{
 wp_dropdown_pages(array('name' => 'page_on_front','echo' =>
 0,'show_option_none' => __( '— Select —' ),'option_none_value'
 => '0','selected' => get_option( 'page_on_front' ),))
 => string(483) "<select name='page_on_front' id='page_on_front'>
         <option value="0">— Select —</option>
         <option class="level-0" value="51">Activate</option>
         <option class="level-0" value="45">Activity</option>
         <option class="level-0" value="55">Blog</option>
         <option class="level-0" value="49">Groups</option>
         <option class="level-0" value="47">Members</option>
         <option class="level-0" value="53">Register</option>
         <option class="level-0" value="2">Sample Page</option>
 </select>
 }}}


 The concept of the patch is to remove the filter for '**{{{get_pages}}}**'
 with the callback to the function
 **{{{bp_core_include_directory_on_front}}}**, when the **'legacy'
 BuddyPress URL Parser** is in use thus, preventing the duplication of the
 **Activity**, **Groups** & **Members** 'page on front' option values.

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


More information about the buddypress-trac mailing list