Skip to:
Content

BuddyPress.org

Opened 15 years ago

Closed 15 years ago

#3354 closed defect (bug) (fixed)

Activity comments with embed links don't show on initial AJAX load

Reported by: DJPaul Owned by:
Priority: normal Milestone: 1.5
Component: Core Version: 1.5
Severity: Keywords: has-patch
Cc:

Description

When posting, for example, a youtube link into an activity stream comment (or a status update), the AJAX returns the plain text version of the link. When the page is refreshed, the embed is loaded.

This is because DTheme's ajax implementation seems to happen before the bp_init hook is fired. If you hard-code a call to bp_embed_init() in the ajax handler, it fixes this problem. However, if you're posting a status update, there is also some javascript to copy your most recent activity into span.activity in the member header... it copies the html from the ajax response, so you also get a youtube box in there.

I've put this ticket to 1.4 as I can't see an easy way around it as it seems its caused by DTheme 1.3's javascript. Re-hooking all the AJAX calls is too big a task for the 1.3 beta release.

Attachments (2)

3354.01.patch​ (407 bytes ) - added by r-a-y 15 years ago.
3354.02.patch​ (3.5 KB ) - added by r-a-y 15 years ago.

Download all attachments as: .zip

Change History (8)

#1 @r-a-y
15 years ago

This used to work on an earlier version of BP 1.3-bleeding as-is.

However, in current trunk, you can fix this by changing the priority of bp_embed_init() to 9:

add_action( 'bp_init', 'bp_embed_init', 9 );

#2 @r-a-y
15 years ago

  • Keywords has-patch added

#3 @DJPaul
15 years ago

Yes, but, as per the ticket description:

However, if you're posting a status update, there is also some javascript to copy your most recent activity into span.activity in the member header... it copies the html from the ajax response, so you also get a youtube box in there.

See ​http://i52.tinypic.com/8wze48.png

#4 @r-a-y
15 years ago

Ahh okay, gotcha!

The attached patch uses .text() instead of .html() for the AJAX #latest-update.
I've also localized the "View" link.

#5 @DJPaul
15 years ago

  • Milestone 1.4 → 1.3

#6 @djpaul
15 years ago

  • Resolution → fixed
  • Status new → closed

(In [4727]) Fix oembed activity comments when posting with AJAX. Fixes #3354, props r-a-y

Note: See TracTickets for help on using tickets.