[buddypress-trac] [BuddyPress] #4081: Failed activity pages due to bad logic in bp_is_current_component

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Wed Jun 13 06:30:06 UTC 2012


#4081: Failed activity pages due to bad logic in bp_is_current_component
-------------------------------------+--------------------
 Reporter:  chrisbliss18             |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  1.5.6
Component:  Core                     |     Version:  1.5.4
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |
-------------------------------------+--------------------

Comment (by cnorris23):

 Although I can't replicate the failed activity pages, I can replicate the
 array_search failure.


 > I seem to remember that the purpose of the array_search() clause was for
 backward compatibility with the pre-1.5 method of storing components in
 $bp->active_components, in which component names sometimes *were* the
 array values instead of the keys. (IIRC, 'canonical' component names were
 the keys, and component slugs were the values.)

 From what I can tell, this is correct. The recommended, pre-bp-core-
 component.php, way of registering a component was

 {{{ $bp->active_components[$component_slug] = $component_id; }}}

 New patch changes the active_components array from
 {{{
 array(
     'activity' => true,
     ...
 );
 }}}

 to

 {{{
 array(
     'activity' => 1,
     ...
 );
 }}}

 Running array_search with STRICT set to true fixes the issue, but, in my
 opinion, we're just asking for more edge cases going that route. Patch was
 written on branch, but applied cleanly to trunk as of [6074].

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4081#comment:4>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list