Skip to:
Content

#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)

4525.001.patch (4.2 KB) - added by DJPaul 19 months ago.

Download all attachments as: .zip

Change History (10)

comment:1 DJPaul20 months ago

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

Confirmed on trunk

comment:2 DJPaul20 months 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 );

comment:3 financetrain20 months ago

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

comment:4 boonebgorges20 months 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.

comment:5 DJPaul20 months 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.

comment:6 boonebgorges20 months 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.)

DJPaul19 months ago

comment:7 DJPaul19 months 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 19 months ago by DJPaul (previous) (diff)

comment:8 mercime18 months ago

  • Cc mercijavier@… added

comment:9 johnjamesjacoby17 months 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.