Skip to:
Content

BuddyPress.org

Opened 11 years ago

Closed 11 years ago

#5166 closed defect (bug) (fixed)

Doubling the same actions

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

Description

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 11 years ago.

Download all attachments as: .zip

Change History (5)

#1 @slaffik
11 years ago

  • Cc slaffik added

#2 @boonebgorges
11 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.

@boonebgorges
11 years ago

#3 @johnjamesjacoby
11 years ago

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

#4 @boonebgorges
11 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.