Skip to:

Opened 5 years ago

Closed 5 years ago

#5166 closed defect (bug) (fixed)

Doubling the same actions

Reported by: slaFFik Owned by: boonebgorges
Milestone: 1.9 Priority: normal
Severity: major Version: 1.8.1
Component: Groups Keywords: has-patch needs-testing
Cc: slaffik


In one of my plugins I display additional navigation using bp_before_group_body hook.
Now lets see how BuddyPress loads pages in theme compatibility mode:
1) You open the group page, /groups/single/home.php is loaded (where header and groups inside data logic). This file has this line on line ~27:

<?php do_action( 'bp_before_group_body' ); ?>

2) In case none of if's below it satisfies the current request it loads /groups/single/plugins.php. And inside that file we again have the same hook.

<?php do_action( 'bp_before_group_body' ); ?>

The same for

<?php do_action( 'bp_after_group_body' ); ?>

This creates possible content duplication. Like in my plugin's case.

Attachments (1)

5166.patch (667 bytes) - added by boonebgorges 5 years ago.

Download all attachments as: .zip

Change History (5)

#1 @slaffik
5 years ago

  • Cc slaffik added

#2 @boonebgorges
5 years ago

  • Keywords has-patch needs-testing added
  • Milestone changed from Awaiting Review to 1.9

Confirmed. We changed the way plugins.php worked in bp-legacy; before theme compat, it was loaded from bp_core_load_template(), so that in these cases home.php was never touched. Once it started getting nested in home.php, we never lost the duplicate hooks.

In fact, we also have duplicate markup - #item-body.

I'm pretty sure the solution is as simple as 5166.patch, but I would like a sanity check from another dev that this isn't going to break stuff.

5 years ago

#3 @johnjamesjacoby
5 years ago

Patch looks good to me. Was a copy/paste job that never saw clean-up after testing the main action.

#4 @boonebgorges
5 years ago

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

In 7377:

Remove duplicate markup and actions from bp-legacy groups plugins template

The removed actions and markup are remnants of the original cut-and-paste
from bp-default (where plugins.php was a top-level template) into bp-legacy
(where it is not).

Fixes #5166

Note: See TracTickets for help on using tickets.