Skip to:

Opened 12 years ago

Closed 12 years ago

#4525 closed defect (bug) (wontfix)

Join Group button disappears on ajax call

Reported by: financetrain's profile financetrain Owned by:
Milestone: Priority: normal
Severity: normal Version: 1.6
Component: Groups Keywords: has-patch
Cc: mercijavier@…


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)

4525.001.patch (4.2 KB) - added by DJPaul 12 years ago.

Download all attachments as: .zip

Change History (10)

#1 @DJPaul
12 years ago

  • Milestone changed from Awaiting Review to 1.6.2
  • Severity changed from major to normal

Confirmed on trunk

#2 @DJPaul
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 );

#3 @financetrain
12 years ago

Is there something I can do to temporarily patch this problem? Thanks!

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

12 years ago

#7 @DJPaul
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

Last edited 12 years ago by DJPaul (previous) (diff)

#8 @mercime
12 years ago

  • Cc mercijavier@… added

#9 @johnjamesjacoby
12 years ago

  • Milestone 1.7 deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Doesn't seem worth it, considering the commitment we'd be making to supporting this in bp-default. Closing as wontfix, as theme compat will enable us to fix this easier if it comes up again.

Note: See TracTickets for help on using tickets.