Skip to:
Content

BuddyPress.org

Opened 14 years ago

Closed 14 years ago

Last modified 10 years ago

#4736 closed defect (bug) (fixed)

"join group" and similar buttons missing in listings for ajax browsing

Reported by: magnus78 Owned by:
Priority: low Milestone: 1.7
Component: Templates Version:
Severity: minor Keywords: has-patch
Cc:

Description

The "join group" button is missing in the groups listing when the content was fetched using ajax. This is because the ajax requests go through wp-admin/admin-ajax.php, and adding those buttons is protected by a is_admin() clause.

The same it true for other listings.

Attachments (2)

trac4736_bp_ajax_missing_buttons.patch (2.2 KB ) - added by magnus78 14 years ago.
proposed fix
trac4736_bp_ajax_missing_buttons_v2.patch (518 bytes ) - added by magnus78 14 years ago.
proposed fix, v2

Download all attachments as: .zip

Change History (8)

#1 @magnus78
14 years ago

The patch just removes the

if ( !is_admin() )

#2 @sbrajesh
14 years ago

Instead removing if ( !is_admin() )
It will be a better approach to put the condition like this

if ( !is_admin()||(is_admin()&&defined('DOING_AJAX')) ) 


#3 @magnus78
14 years ago

That works too, dunno if it's worth the bother.

#4 @boonebgorges
14 years ago

  • Milestone Awaiting Review1.7
  • Priority normallow
  • Severity normalminor

We need the is_admin() check because of some load-order problem that otherwise occur in the dashboard.

#5 @boonebgorges
14 years ago

  • Resolutionfixed
  • Status newclosed

(In [6679]) Ensure that directory/header buttons are hooked when doing AJAX

Directory buttons (such as Join Group) were previously added only when
!is_admin(), to avoid fatal errors in the Dashboard when certain template
functions were undefined. This caused problems when the directory was refreshed
using AJAX, because is_admin() returns true when making calls to
admin-ajax.php. This changeset does an additional check to make sure that
the buttons are added correctly when DOING_AJAX, even if is_admin() returns
true.

Fixes #4736

Props magnus78, sbrajesh

#6 @DJPaul
10 years ago

  • Component Appearance - Template PartsTemplates
Note: See TracTickets for help on using tickets.