Opened 11 years ago
Closed 11 years ago
#4956 closed defect (bug) (no action required)
BP_Group_Extension::display no longer displays page content
Reported by: | dconrad | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 1.7 |
Component: | Groups | Keywords: | reporter-feedback |
Cc: | dconrad |
Description
I tried to set the template file explicitly to see if it would do anything.
$this->template_file = ‘wrc/templates/bulletin-board/home.php’;
In my display function, none of these seem to work at all, but they used to.
function display() {
locate_template( array( ‘wrc/templates/bulletin-board/home.php’), true);
bp_get_template_part( ‘wrc/templates/bulletin-board/home’ );
echo "Bulletin Board";
?>
Welcome to my cool group extension!
<?php
}
Attachments (1)
Change History (20)
#2
@
11 years ago
WordPress 3.5.1, Buddypress 1.7.
No other plugins.
I am using my own custom developed theme.
To reproduce: Include the attached file. Create a group. Each group extension should be available as a menu item. Click on "Bulletin Board". Display should be showing as defined in the display method.
#5
@
11 years ago
Thanks very much for sharing, dconrad.
I've tested it out, and the display() method is getting called fine for me - I see BULLETIN BOARD when I click on the 'Bulletin Board' tab of a group.
It's possible that this has something to do with the way you're bootstrapping the plugin. Here's how I'm doing it (in wp-content/bp-custom.php):
function bp4956() { include( __DIR__ . '/wrc-classes.php' ); } add_action( 'bp_setup_globals', 'bp4956' );
By loading at 'bp_setup_globals', I can be ensured that I'm loading *after* BP_Group_Extension
has been defined (so I don't get a fatal error), but *before* 'bp_actions', which is where the display callback gets hooked.
How are you doing it? Are you including it from functions.php of your theme or something like that?
#6
@
11 years ago
I have tried both from functions.php and from a plugin since upgrading to 1.7 (both worked before).
However, I had it as
function wrc_loader() {
if ( bp_is_active( 'groups' ) ) {
require( dirname(FILE) . '/wrc-classes.php' );
}
}
add_action( 'bp_include', 'wrc_loader' );
I will change it to the bp_setup_globals and try again!
#7
@
11 years ago
- Severity changed from blocker to normal
Odd. It works fine for me when hooked to 'bp_include', both on 1.6.x and 1.7.x. 'bp_include' runs in plenty of time to hook the display()
method, so I'd be surprised if that had anything to do with it.
Try your plugin on a fresh install of BP. I bet there's a plugin conflict or something that's causing this issue.
#8
@
11 years ago
Ya. I just tried from bp-custom and it's not even registering the extensions.
I'll try from a fresh install and update.
Thanks.
#11
@
11 years ago
Group Extensions appear to be registered, but display() just doesn't do anything.
#12
@
11 years ago
- Keywords reporter-feedback added
dconrad - Please test another plugin that uses BP_Group_Extension to see if it's working. Try, eg, BuddyPress Docs. If the group tab works, then the problem lies in the code you're using to bootstrap your plugin. If it doesn't, then there's something specific about your installation that is causing the problem.
Also, if you haven't done so yet, please test on a fresh installation of WP/BP with your existing plugin code.
#13
@
11 years ago
I have a clean, fresh install of WP/BP. The Group Announcements plugin works great. My extensions are registering fine, and getting nav items, but display still doesn't seem to work still though.
#15
@
11 years ago
I had some residual template issues from previous theme modifications (pre 1.7). My code only seems to work when called from bp-custom though
#16
@
11 years ago
My code only seems to work when called from bp-custom though
As opposed to what? A plugin file? Or a theme's functions.php?
The group extension does work in general; I have dozens of plugins that use it, and are working properly.
Can you please share the complete code of your extension, along with a description of your environment? (WP/BP versions, theme, plugins) Also, complete details on how to reproduce the issue.