Skip to:

Opened 14 years ago

Closed 14 years ago

#2338 closed defect (bug) (fixed)

bp-activity-templatetags Slugs

Reported by: laullon's profile laullon Owned by:
Milestone: 1.5 Priority: normal
Severity: Version:
Component: Activity Keywords: bp-activity-templatetags BP_GROUPS_SLUG BP_FRIENDS_SLUG


bp-activity-templatetags.php must user BP_GROUPS_SLUG and BP_FRIENDS_SLUG instead 'groups' and 'friends'

if ( 'just-me' == $scope if ( 'just-me' == $scope
'friends' == $scope 'groups' == $scope 'favorites' == $scope 'mentions' == $scope ) {
BP_FRIENDS_SLUG == $scope BP_GROUPS_SLUG == $scope 'favorites' == $scope 'mentions' == $scope ) {

case 'friends':

case 'groups':

Change History (7)

#1 @johnjamesjacoby
14 years ago

  • Milestone changed from 1.2.4 to 1.3

This needs to get done but touches too many files for it to make it into 1.2.4.

Bumped to 1.3.

#2 @boonebgorges
14 years ago

I agree that this needs to be done in various places throughout BP, but I'm not sure that the specific location mentioned in bp-activity-templatetags.php is one of them. The strings in question ('friends' and 'groups') are literals that are function arguments. Unlike URL slugs, they're not user-facing at all (and they have no connection to anything user-facing, since they're entered on the template), so there's not a hugely compelling argument for making them translatable. On the other hand, there is an argument (albeit perhaps a small one) for not making them translatable: documentation like becomes a bit more complicated, because you can no longer say for certain what the 'object' parameter should be for core components.

#3 @boonebgorges
14 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [3337]) Relativizes various URL creation and current_component/current_action checks to use slugs rather than string literals. Fixes #2338

#4 @DJPaul
14 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

I think we need to use $bp->pages->{profile}->slug & ->name for trunk to support page renaming in wp-admin. I haven't tested this yet.

#5 @DJPaul
14 years ago

We probably need something like a bp_get_current_component_slug() too.

#6 @boonebgorges
14 years ago

Re: $bp->pages support. $bp->pages is set up via a chain that ends in bp-core.php, bp_core_get_page_names(). That function shows that $bp_pages is set by 1) getting the IDs of bp-pages from the options table, and then 2) directly querying the posts table for the slugs. In other words, page renaming should already be taken care of.

$bp->current_component (and current_action) are set in bp_core_set_uri_globals() (bp-core-catchuri.php) by breaking the REQUEST URI into uri chunks. So current_component should always correspond to component slugs, since they're guaranteed to be formatted for appearances in URIs. bp_get_current_component_slug() therefore seems like it'd be redundant with bp_current_component().

#7 @boonebgorges
14 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

Something is broken with page renaming, but it's not related to this ticket. Opening a new one: #2778

Note: See TracTickets for help on using tickets.