Skip to:
Content

BuddyPress.org

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#4488 closed defect (bug) (fixed)

Activity stream not stripping caption shortcodes again in 1.6.1

Reported by: rossagrant's profile rossagrant Owned by:
Milestone: 1.7 Priority: lowest
Severity: minor Version: 1.6.1
Component: Blogs Keywords:
Cc:

Description

Hi guys,

This issue came up a few versions ago and I have once again noticed it back in 1.6.1 (not sure if it was in 1.6 too).

The original ticket and patch was here:
http://buddypress.trac.wordpress.org/ticket/3697

Same kind of issue with caption and shortcode being fed into the activity stream excerpt.

To replicate is simple:

-Open a new post
-Place a picture with a caption BUT NO LINK into the post
-Publish
-You will see the caption and the closing caption shortcode in the stream item

Tested on 2 installs and a brand new install of 1.6.1 with no plugins at all running.

Attachments (1)

4488.patch (683 bytes) - added by boonebgorges 12 years ago.

Download all attachments as: .zip

Change History (14)

#1 @rossagrant
12 years ago

To update this ticket, i have just tried to replicate this issue in BP 1.5.7 and I can't.

BP 1.5.7 works perfectly, so the problem obviously is in the later versions.

The patch still exists intact in 1.6.1 but obviously isn't working any longer.

#2 @boonebgorges
12 years ago

Not sure why, but for some reason it looks like reverting the change in r5351 fixes the issue. rossagrant, will you try that on your installation?

I'm wary of simply reverting without understanding why this is happening, though. Anyone have insight?

#3 @rossagrant
12 years ago

Hey Boone, yep reverting the patch in BP fixes my issue completely.

NO idea why though! Bit bizarre, but that does sort the issue!

Anyone any ideas why?

#4 @rossagrant
12 years ago

  • Version changed from 1.6 to 1.6.1

Hey Boone!

Noticed that this fix didn't get reverted in 1.6.2 and so the weird caption text is still showing in the stream.

I have just tried reverting the above patch in 1.6.2 and again it fixes the problem.

This needs to be committed to 1.6.2.1 I think.

Works perfectly.

What do you think?

#5 @boonebgorges
12 years ago

  • Milestone changed from Awaiting Review to 1.7

It'll need more testing.

#6 @rossagrant
12 years ago

Cool, let me know if I can help, but all has been good with this revert since 1.6.1 for me!

#7 @johnjamesjacoby
12 years ago

No need for a 1.6.2.1, and I'd like to avoid a 1.6.3. 1.7 is due for beta soon; maybe you can switch to trunk, and help us get it ready for release?

#8 @boonebgorges
12 years ago

  • Component changed from Core to Blogs
  • Keywords has-patch needs-testing added
  • Priority changed from normal to lowest
  • Severity changed from normal to minor

Looks like there are two problems with the existing regex:

  1. It wasn't accounting for the existence of any caption text (in addition to the <img> element)
  2. There was some incorrect syntax for detecting the [/coption] closing shortcode

Please test 4488.patch to see if it works for you (rossagrant, this means you!)

@boonebgorges
12 years ago

#9 @johnjamesjacoby
12 years ago

  • Keywords reporter-feedback commit added; needs-testing removed

Patch looks good to me.

#10 @boonebgorges
12 years ago

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

(In [6723]) Hone the regex for stripping [caption] shortcode from blog activity items.

Fixes #4488

#11 @rossagrant
12 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Hey Boone!

So sorry guys, I've not kept up with this.

I haven't got a 1.7 install running yet but I've tested this with 1.6.3 (not sure if that's totally the right thing to do?)

I think this new patch is fine for images WITH captions but now causes stream issues with posts that don't have a caption in the picture.

Steps to replicate:

  • Create a new post.
  • Insert a picture with NO CAPTION.
  • Write your post AFTER the image (so image is basically top left of post).
  • Publish.

For some reason, the stream creates the thumbnail image as normal, but it then places the FULL SIZE image into the activity item too.

This DOESN'T happen if the image HAS a caption - you get just the thumbnail.

Have tested on new install of BP 1.6.3/ WP 3.5 with new patch.

If this is a 1.7 patch ONLY, then let me know and I'll get a 1.7 install up somewhere.

Thanks again!

#12 @boonebgorges
12 years ago

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

(In [6742]) More regex fixes in bp_activity_thumbnail_content_images()

Fixes #4488

#13 @boonebgorges
12 years ago

  • Keywords has-patch reporter-feedback commit removed

I had another look and you're right. I believe the latest commit should cover the various cases.

Unit tests added at https://github.com/buddypress/BuddyPress-Unit-Tests/commit/808d7f9eb1da4da70f51034c1bc5fec97b682fc8

Note: See TracTickets for help on using tickets.