Skip to:

Opened 8 years ago

Closed 8 years ago

#6777 closed defect (bug) (fixed)

Typo in bp_activity_set_post_type_tracking_args()

Reported by: danbrellis's profile danbrellis Owned by: imath's profile imath
Milestone: 2.5 Priority: normal
Severity: minor Version: 2.2
Component: Activity Keywords: has-patch commit
Cc: dcavins


The function bp_activity_set_post_type_tracking_args adds the post labels in a foreach loop, and then unsets each $arg that was passed to it.

The function says

unset( $args[ $post_type ] );

but since there is no $post_type key in the $args array, I think it should actually be:

unset( $args[ $label_type ] );

Was just poking around in the code and noticed this so sorry if I'm off base here.

Attachments (1)

6777.patch (2.1 KB) - added by imath 8 years ago.

Download all attachments as: .zip

Change History (8)

#1 @dcavins
8 years ago

  • Cc dcavins added
  • Version set to 2.4.0

Hi @danbrellis-

Thanks for your bug report! I'm not terribly familiar with this particular cul-de-sac of the BuddyPress code, but I agree with your conclusion--it looks like what's meant to happen here is those label arguments are unset so they aren't added to the $wp_post_types global.

Thanks again for taking the time to write up a report.

#2 @imath
8 years ago

  • Version changed from 2.4.0 to 2.2


Yes sorry for this typo error. This function is not used by BuddyPress internally but is there for plugins wishing to add BuddyPress Post type activities:

The goal was to only have the labels ( inside the array like 'bp_activity_admin_filter' ) in $wp_post_types[ $post_type ]->labels and not "repeated" inside $wp_post_types[ $post_type ]->bp_activity.

Last edited 8 years ago by imath (previous) (diff)

#3 @imath
8 years ago

  • Owner set to imath
  • Status changed from new to assigned

#4 @imath
8 years ago

  • Keywords needs-unit-tests added
  • Milestone changed from Awaiting Review to 2.5

#5 @imath
8 years ago

  • Keywords has-patch added; needs-patch needs-unit-tests removed

6777.patch is fixing the typo, i've added a unit test.

8 years ago

#6 @DJPaul
8 years ago

  • Keywords commit added

Tested, looks good.

#7 @imath
8 years ago

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

In 10412:

Fix a typo in the bp_activity_set_post_type_tracking_args() function

Add a unit test to check activity tracking arguments are added the same way to the post type when setting them within register_post_type() or using the bp_activity_set_post_type_tracking_args()

Props danbrellis

Fixes #6777

Note: See TracTickets for help on using tickets.