Skip to:
Content

BuddyPress.org

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#4897 closed enhancement (fixed)

Loading more activities after an update displays last activity in double

Reported by: imath's profile imath Owned by: boonebgorges's profile boonebgorges
Milestone: 1.8 Priority: low
Severity: minor Version: 1.7
Component: Activity Keywords: has-patch needs-testing
Cc:

Description

Hi,

I hope, i'll succeed to explain this minor "issue" in english!!

Let's say, there's 21 activities in database. When i go on Activity directory, i have 20 activities displayed and the load more link.
Now imagine, i post a new activity, i have 21 activities displayed and the load more link.
Now if i click on the load more link, the activity just before the load more link will be displayed again, and we get the same id in double (for instance : #activity-20)

So i thought, the easiest way to avoid this, is to "remove from display" the activity just before the load more link in case of a new update.

You'll find the javascript enhancement in the diff attached to this ticket

Attachments (3)

4897.diff (1.2 KB) - added by imath 12 years ago.
4897.01.diff (4.0 KB) - added by imath 12 years ago.
4897.02.diff (4.1 KB) - added by imath 12 years ago.

Download all attachments as: .zip

Change History (12)

@imath
12 years ago

#1 @boonebgorges
12 years ago

  • Milestone changed from Awaiting Review to Future Release
  • Priority changed from normal to low

@imath
12 years ago

#2 @imath
12 years ago

4987.01.diff seems to be better. I've noticed in a plugin i'm working on that if the order of the query changes then the previous method is not working well.

#3 follow-up: @DJPaul
12 years ago

  • Keywords needs-refresh added; has-patch 2nd-opinion removed
  • Milestone changed from Future Release to 1.8

imath; interested in getting this into 1.8?

The patch needs another look, if only because doing this is unsafe: :)

$qs[] = 'exclude=' . $_POST['exclude_just_posted']

#4 in reply to: ↑ 3 @imath
12 years ago

Replying to DJPaul:

imath; interested in getting this into 1.8?

Yes !! i'll check this tomorrow to make it safer ;)

@imath
12 years ago

#5 @imath
12 years ago

  • Keywords has-patch added; needs-refresh removed

Just added 4897.02.diff (using wp_parse_id_list() to be sure ids are int)

#6 @DJPaul
12 years ago

  • Keywords needs-testing added

#7 follow-up: @boonebgorges
12 years ago

Great patch, imath. I've cleaned it up a bit, but the technique works well for me.

#8 @boonebgorges
12 years ago

  • Owner set to boonebgorges
  • Resolution set to fixed
  • Status changed from new to closed

In 7116:

Exclude dynamically added activity items when clicking Load More in directory

This prevents duplicate items appearing after Load More due to the numeric
offset caused by AJAX-inserted activity items.

Fixes #4897

Props imath

#9 in reply to: ↑ 7 @imath
12 years ago

Replying to boonebgorges:

Great patch, imath. I've cleaned it up a bit, but the technique works well for me.

Thanks @boone ;)

Note: See TracTickets for help on using tickets.