[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
Fri Mar 16 00:08:15 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.5
Component:  Core                     |     Version:  1.5.4
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |
-------------------------------------+--------------------
Changes (by boonebgorges):

 * milestone:  Awaiting Review => 1.5.5


Comment:

 Thanks for the in-depth report and patches, Chris.

 I will need to do more research to be sure, but 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.) So the clause was meant to cover a specific
 (albeit edge) case: where someone was passing a component *slug* to
 bp_is_current_component(), and the component being checked was registered
 in the array by a plugin that had not been updated properly for the new BP
 1.5+ active_components array format.

 Again, this is off the top of my head - I will have to go back to BP
 1.2.10 and the changelogs to find the answer. But if I'm right, then
 probably the check should stay there, but we should be doing strict
 array_search() checking, to avoid the problem you originally found, and we
 should be internally consistent about how we build $bp->active_components.

 Putting in the 1.5.5 milestone for the moment, though we may have to punt
 it past, as there is an unrelated reason why 1.5.5 has to come out in the
 next couple days and I don't want this ticket to hold it up.

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


More information about the buddypress-trac mailing list