Skip to:
Content

BuddyPress.org

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#6554 closed defect (bug) (worksforme)

No excerpts for blog posts in activity after BP upgrade

Reported by: schwarzaufweiss's profile schwarzaufweiss Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.3.2
Component: Activity Keywords:
Cc:

Description

I've upgraded my site from WP 3.9.x to WP 4.2.2 and from BP 2.0.3 directly to 2.3.2.1 – the problem is that I no longer have excerpts for blog posts in activity stream, it's always the full blog post (including an image)...
https://www.info.ch/activity/
...only the very first post (the one by Anneliese Breitner) got an excerpt. I'm using a premium theme but it's the same situation if I switch to a standard WP theme, e.g. twenty fourteen.

Change History (6)

This ticket was mentioned in Slack in #buddypress by boone. View the logs.


9 years ago

#2 @imath
9 years ago

  • Keywords reporter-feedback added

Hi @schwarzaufweiss

I think, the problem might have been caused by your premium theme or a specific plugin.

When an activity is generated for a newly published post, we directly save an excerpt into the content field of the activity table. If you have the full content, this means something (theme or plugin) was overriding our behavior to save the full content.

Before 2.3, each activity was truncated, that's why you had the impression an excerpt was used for posts see: https://buddypress.trac.wordpress.org/browser/branches/2.2/src/bp-activity/bp-activity-filters.php#L402

Since 2.3 if the activity is a new blog post, it's not truncated, see : https://buddypress.trac.wordpress.org/browser/trunk/src/bp-activity/bp-activity-filters.php#L418

I can see a good reason for this, but maybe @djpaul can explain it to you better than i'd do. I think as we are already saving an excerpt for the new_blog_post activity, there's no reason to truncate the activity as it already is in DB.

If you need to have the activity truncated for new_blog_post activity like it was the case before 2.3 the one thing (theme or plugin) who's overriding BuddyPress behavior (to save full content instead of the excerpt of it) should simply use this filter :

add_filter( 'bp_activity_maybe_truncate_entry', '__return_true' );

If that's ok for you, i think we can close this ticket because imho it's not a BuddyPress bug.

#3 @schwarzaufweiss
9 years ago

  • Keywords reporter-feedback removed
  • Severity changed from normal to major

Hi @imath

After some more testing I found one reason what could be related to this problem: if you post while using the WP text editor, nothing is registered in activity! Only if you «place» an image (using HTML) while using the text editor, that will show up in activity. If you use the visual editor to compose, registering of blog posts in acitivty works fine!

#4 @imath
9 years ago

  • Keywords reporter-feedback added
  • Severity changed from major to normal

@schwarzaufweiss

Can we work on one problem at a time or by ticket ?

I suggest we stay focus on the excerpt trouble on this ticket. Do we agree about my latest comment ?

FYI, i've just tested publishing a new post using the text editor with no image and just text, there's no problem at all. If it's not the case for you with a default configuration (no plugin/a twenty theme), i suggest you open a new ticket for this problem.

#5 @schwarzaufweiss
9 years ago

  • Keywords reporter-feedback removed
  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed

@imath

Sorry Mathieu, I never had the intention to mix and match. My thought was that one thing could have to do with the other…

We've put the truncate filter in bp-custom.php and the excerpts for older blog posts are now correctly showing up.

Thanks!

#6 @imath
9 years ago

No problem at all :) i really think there's no link between both troubles.

Thanks a lot for your reply.

Note: See TracTickets for help on using tickets.