Skip to:
Content

BuddyPress.org

Opened 12 years ago

Closed 12 years ago

Last modified 8 years ago

#4931 closed defect (bug) (fixed)

Add Friend - Cancel Friendship Request buttons behave inconsistently

Reported by: dontdream's profile dontdream Owned by: boonebgorges's profile boonebgorges
Milestone: 1.7.1 Priority: normal
Severity: minor Version: 1.7
Component: Templates Keywords: commit
Cc:

Description

Go to the Members directory and using the pagination links go, say, to page 2. If you click one of the 'Add Friend' buttons, the page reverts to page 1. Go to page 2 again, and the clicked 'Add Friend' button has correctly changed to 'Cancel Friendship Request'. If you click it now, that takes you to the page "domain.com/members/admin/friends/requests/" where it correctly says "Friendship request withdrawn".

The expected behavior would be a simple fade in / fade out of the 'Add Friend' and 'Cancel Friendship Request' buttons when you click them, as BP 1.6.4 does.

Attachments (1)

4931.patch (880 bytes) - added by boonebgorges 12 years ago.

Download all attachments as: .zip

Change History (10)

#1 @boonebgorges
12 years ago

  • Keywords reporter-feedback added

Can you give more details about your setup? What theme are you using, and what other BP plugins?

Would you mind opening a JS console in your browser, to see if there are any errors in the AJAX request? Or maybe you'll find that the AJAX request isn't firing at all?

#2 @dontdream
12 years ago

  • Keywords reporter-feedback removed

My setup is a clean WP 3.5.1 installation with BP 1.7 only. I did import a few users for testing, and they are all marked 'Never active', so to see them you have to select Order By: Alphabetical.

I didn't see any JS errors, but you are welcome to have a look at http://anantir.com/clean17/, user: tester, pass: test

#3 @boonebgorges
12 years ago

  • Milestone changed from Awaiting Review to 1.7.1
  • Owner set to boonebgorges
  • Severity changed from normal to minor
  • Status changed from new to assigned
  • Type changed from enhancement to defect (bug)

Thanks. I've confirmed the issue. The problem is the pagination: because pages beyond #1 are loaded via AJAX, we need to use event delegation to bind the click event to the .friendship-button elements. See also #4458.

The change is a result of r6635, which moved us from jQuery.live() to jQuery.on(). That migration was done incorrectly in this case (and, I'd wager, in the case of group directories as well).

Because this is a regression from 1.6.x, I'm tentatively putting it in the 1.7.1 milestone. I can write a patch later; it should be straightforward. If any devs object to making significant JS changes in a maintenance release, I suppose we can move it to 1.8.

#4 @boonebgorges
12 years ago

  • Keywords has-patch added

See 4831.patch for proposed fix. If there are no objections, I'll apply it to 1.7.x as well as trunk.

@boonebgorges
12 years ago

#5 @DJPaul
12 years ago

  • Keywords commit added; has-patch removed

Patch needs less foo, but otherwise just right.

#6 @boonebgorges
12 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

#7 @boonebgorges
12 years ago

In 6972:

Use event delegation for directory buttons in bp-legacy

This ports r6919 to bp-legacy

See #4931, #4969

#8 @boonebgorges
12 years ago

In 6973:

Use event delegation for directory buttons in bp-legacy

This ports r6919 to bp-legacy

See #4931, #4969

#9 @DJPaul
8 years ago

  • Component changed from Appearance - Template Parts to Templates
Note: See TracTickets for help on using tickets.