Opened 12 years ago
Closed 12 years ago
#4525 closed defect (bug) (wontfix)
Join Group button disappears on ajax call
Reported by: | financetrain | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 1.6 |
Component: | Groups | Keywords: | has-patch |
Cc: | mercijavier@… |
Description
The problem is on the groups directory page. When an ajax call is made (say by changing a filter or clicking on the next page number), the 'Join Group' button disappears.
Attachments (1)
Change History (10)
#1
@
12 years ago
- Milestone changed from Awaiting Review to 1.6.2
- Severity changed from major to normal
#2
@
12 years ago
- Version changed from 1.6.1 to 1.6
Problem is in bp_dtheme_setup(). Around the button registrations on AJAX when logged in, is_admin() returns true. wp-admin/admin-ajax.php sets:
define( 'DOING_AJAX', true );
define( 'WP_ADMIN', true );
#4
@
12 years ago
I think we can just remove the is_admin()
check around these hooks in bp_dtheme_setup()
. I assume the original purpose of this was to save a tiny bit of overhead, but it's more or less negligible, since the actions referenced there don't happen on admin screens anyway.
#5
@
12 years ago
Right, but it wouldn't fix the problem for themes that were based on a copy of BP-Default (not child themes), or those which copy/pasted functions.php as a starting point.
#6
@
12 years ago
Hm. I can't think of a good way around this. is_admin()
just checks the constant, which can't be redefined, and there's no filter on the boolean output. We'd only be able to account for the themes you describe if we did it in BP itself, but this is inherently a theme-specific problem. So I say we fix it for the packaged themes, and explain in a bpdevel post or something how it would have to be fixed by theme authors. (Unless someone has a better idea.)
#7
@
12 years ago
- Keywords has-patch added
Added a patch with a suggestion on how to handle this. I'm not sure it's worth it, and we'd need to move the bp_dtheme_fix_buttons() function somewhere out of functions.php, and possibly prevent it running if theme compatibility is active, but up for discussion.
Patch was made against trunk
Confirmed on trunk