Skip to:
Content

BuddyPress.org

Opened 11 years ago

Last modified 4 years ago

#5565 new defect (bug)

BuddyPress 2.0 + P2 = broken mentions and notifications

Reported by: careb's profile careb Owned by:
Milestone: Awaiting Contributions Priority: normal
Severity: normal Version: 2.0
Component: Activity Keywords: needs-testing reporter-feedback
Cc:

Description

Wordpress 3.8.1 (multisite with subdirectories);
buddypress 2.0;
P2 1.5.3;
http://teambox.dongguk.ac.kr/debug/

When using more than 10 @username in a post, BuddyPress freaks out and repeats one of the mentions and adds incremental numbers after the @username, like:

@siegler @jake @groba @buckley @heath @daniel @daryl @stacy @virginia
@steve @jake0 @jake1 @jake2 @jake3 @jake4

If I try to edit the post, the correct @usernames are there without the numbers. Everything looks normal. When I publish, the numbers reappear. Notification emails do not go out to users after the names begin repeating or the numbers get added.

To really see how bad it is, I made a test post with more than 25 @usernames:

@amber @barney @beth @catw @david @dermot @kingsley @hahapauli @leeg @barney @beth @catw @david @dermot @kingsley @hahapauli @leeg @matt @mckerron @michael @patty @phymus @qiana @sabs @sherwin @stuart @virginia @timr @jenhowell77 @siegler @jake @groba @buckley @heath @daniel @daryl @stacy @virginia @steve @paige @patty @amber0 @barney @beth @catw @david @dermot @kingsley @hahapauli @leeg @matt @mckerron @michael @patty @phymus @qiana @sabs @sherwin @stuart @virginia @timr @jenhowell77 @siegler @jake @groba @buckley @heath @daniel @daryl @stacy @virginia @steve @paige @patty @amber1 @barney @beth @catw @david @dermot @kingsley @hahapauli @leeg @matt @mckerron @michael @patty @phymus @qiana @sabs @sherwin @stuart @virginia @timr @jenhowell77 @siegler @jake @groba @buckley @heath @daniel @daryl @stacy @virginia @steve @paige @patty @amber2 @barney @beth @catw @david @dermot @kingsley @hahapauli @leeg @matt @mckerron @michael @patty @phymus @qiana @sabs @sherwin @stuart @virginia @timr @jenhowell77 @siegler @jake @groba @buckley @heath @daniel @daryl @stacy @virginia @steve @paige @patty @amber3 @barney @beth @catw @david @dermot @kingsley @hahapauli @leeg @matt @mckerron @michael @patty @phymus @qiana @sabs @sherwin @stuart @virginia @timr @jenhowell77 @siegler @jake @groba @buckley @heath @daniel @daryl @stacy @virginia @steve @paige @patty @amber5 @barney @beth @catw @david @dermot @kingsley @hahapauli @leeg @matt @mckerron @michael @patty @phymus @qiana @sabs @sherwin @stuart @virginia @timr @jenhowell77 @siegler @jake @groba @buckley @heath @daniel @daryl @stacy @virginia @steve @paige @patty @amber6 @barney @beth @catw @david @dermot @kingsley @hahapauli @leeg @matt @mckerron @michael @patty @phymus @qiana @sabs @sherwin @stuart @virginia @timr @jenhowell77 @siegler @jake @groba @buckley @heath @daniel @daryl @stacy @virginia @steve @paige @patty @amber7 @barney @beth @catw @david @dermot @kingsley @hahapauli @leeg @matt @mckerron @michael @patty @phymus @qiana @sabs @sherwin @stuart @virginia @timr @jenhowell77 @siegler @jake @groba @buckley @heath @daniel @daryl @stacy @virginia @steve @paige @patty @amber8 @barney @beth @catw @david @dermot @kingsley @hahapauli @leeg @matt @mckerron @michael @patty @phymus @qiana @sabs @sherwin @stuart @virginia @timr @jenhowell77 @siegler @jake @groba @buckley @heath @daniel @daryl @stacy @virginia @steve @paige @patty @amber9 @barney0 @barney2 @barney3 @barney4 @barney5 @barney6 @barney7 @barney8 @barney9 @beth0 @beth1 @barney0 @beth2 @beth3 @barney @beth @catw @david @dermot @kingsley @hahapauli @leeg @matt @mckerron @michael @patty @phymus @qiana @sabs @sherwin @stuart @virginia @timr @jenhowell77 @siegler @jake @groba @buckley @heath @daniel @daryl @stacy @virginia @steve @paige @patty @amber3 @amber @beth4 @beth5

what what typed:

@amber @barney @beth @catw @david @dermot @kingsley @hahapauli @leeg @matt @mckerron @michael @patty @phymus @qiana @sabs @sherwin @stuart @virginia @timr @jenhowell77 @siegler @jake @groba @buckley @heath @daniel @daryl @stacy @virginia @steve @paige @patty @amber @johnwendel @calebx

A user reported this on a subsite and I was able to recreate the effect by making a new post on another subsite with more than 10 @usernames. I then made a third site on the network, and tested this with additional posts.

How do I know it's BuddyPress 2.0?

I've been using BuddyPress 1.9.2 for almost a month without this issue. To be sure though I used the filter to disable mentions the problem went away completely. Buddypress was updated to 2.0 roughly two hours before the first instance was reported.

How do I know it's P2?

When I used another theme, the problem went away.

Change History (14)

#1 @r-a-y
11 years ago

  • Component changed from Core to Activity
  • Keywords reporter-feedback added

There is probably a conflict between the mention filters in P2 and BuddyPress.

You can try adding this line to your P2 theme's functions.php:

remove_filter( 'the_content', 'bp_activity_at_name_filter' );

Or you can create a small plugin with this one line and activate it on your sub-sites where P2 is installed and see if that resolves things.

This will remove BP's mention filter from post content.

It looks like this could be related to #4680.

#2 @careb
11 years ago

  • Keywords needs-testing added

P2 is sitewide and necessary.

I tested with the filter in place already.

If I deploy the filter, the problem goes away completely, but then we don't have mentions anymore or the email notifications that go with them.

It's not a solution for us. Currently, I've told the staff to user mentions with 9 people and if they need to mention more, then to use comments with groups of 9.

This avoids the problem and we get to keep using mentions.

#3 @careb
11 years ago

Okay, I dug into bp-activity-filters.php and removed the patch offered by ninnypants (https://buddypress.trac.wordpress.org/attachment/ticket/4680/4680.1.diff), which wasn't in my 1.9.2 install and mentions display correctly again.

Email notifications are also working again.

If I put the patch back in, the problem reappears on reload of the page.

Last edited 11 years ago by careb (previous) (diff)

#4 @DJPaul
11 years ago

  • Milestone changed from Awaiting Review to 2.0.1

This ticket was mentioned in IRC in #buddypress-dev by paulgibbs. View the logs.


11 years ago

#6 @r-a-y
11 years ago

careb - I tried to duplicate your problem when you first mentioned it, but didn't get the repeating usernames in P2.

Is your issue only cosmetic on the frontend? You say that it looks fine when editing the post. Are users receiving email notifications properly?

I tested with the filter in place already.

Which filter did you remove? Did you try what I mentioned in comment:1?

What other plugins are you using?

#7 @boonebgorges
11 years ago

  • Milestone changed from 2.0.1 to Awaiting Review

I've tried to reproduce this as well, but have been unsuccessful. I'm going to move it out of the 2.0.1 milestone until someone has managed to reproduce.

#8 @careb
11 years ago

  • Keywords reporter-feedback removed

i set up a fresh install of WordPress 3.8.1, P2 1.5.3, and BuddyPress 2.0.1. no other plugins are activated. i have the same bug.

you can see it here: http://teambox.calebx.com/ (username: sockx; password: peach)

r-a-y - yes, i used your suggestion at the top of this ticket

remove_filter( 'the_content', 'bp_activity_at_name_filter' );

but this filter also disables email notifications. notifications aren't something we can go without.

at first it looks just cosmetic, and only happens when the page is rendered, but each time the bug shows mentions get messed up and email notifications do not go out for anyone in the list of mentions--even those at the beginning of the list whose names are not mangled.

i've done more digging and P2 and BuddyPress 2.0+ are rebuilding the mentions with links. i this goes back to the patch in [4680](https://buddypress.trac.wordpress.org/ticket/4680) .

P2 has a mentions.php and from line 25:

// Hooks
add_action( 'init',              array( &$this, 'init'            ), 0 );
add_filter( 'the_content',       array( &$this, 'mention_links'   ), 5 );
add_filter( 'comment_text',      array( &$this, 'mention_links'   ), 5 );
add_filter( 'p2_found_mentions', array( &$this, 'filter_mentions' ), 5 );

i've managed to workaround the but in 2.0.1 again with this change:

// Hooks
add_action( 'init',              array( &$this, 'init'            ), 0 );
add_filter( 'the_content',       array( &$this, 'mention_links'   ), 20 );
add_filter( 'comment_text',      array( &$this, 'mention_links'   ), 20 );
add_filter( 'p2_found_mentions', array( &$this, 'filter_mentions' ), 20 );


this corrects the bug in posts but not in comments. comments are still producing the bug ...

Last edited 11 years ago by careb (previous) (diff)

#9 @boonebgorges
11 years ago

i set up a fresh install of WordPress 3.8.1, P2 1.5.3, and BuddyPress 2.0.1. no other plugins are activated. i have the same bug.

Can you please give the exact steps that you took to duplicate? Obviously, you are setting up some users, and then posting some content. I'm afraid that this issue won't be resolved until a member of the core team can reproduce, and getting some precise details will help with that.

#10 @careb
11 years ago

  • Keywords reporter-feedback added

ah you're right. it's a fresh install, but i used an export of the problematic site to populate the users and post content. so not so fresh.

i wiped the database tables and started over again, same setup as last time, but without importing the data.

i made 14 users and i could't get the bug to show up either.

i wiped the database tables and tried a second and a third time.

the second time:

start with a basic wp-config.php file, no multisite
install WordPress 3.8.1
install P2 1.5.3
install BuddPress 2.0.1
enable multisite
add 14 users in WordPress (one by one with a unique email)
make test post with mentions for all users = no bug
more test posts = no bug
change the functions.php for P2 to my file = bug appears
delete all my custom functions = bug still present
compare the functions.php from my problem site (minus customizations) to the stock functions.php in a new P2 download and the files are the same except for an HTML edit and a CSS edit

this didn't make sense. i wiped the database tables again.

the third time:

start with a basic wp-config.php file, no multisite
install WordPress 3.8.1
add 14 users in WordPress (one by one with a unique email)
make test post with mentions for all users = no bug
enable multisite
make test post with mentions for all users = no bug
install P2 1.5.3
make test post with mentions for all users = no bug
install BuddPress 2.0.1
reload the home page = bug appears
make test post with mentions for all users = bug appears
make test comment with mentions for all users = no bug

check the database tables and no bug, so it's only happening when the page renders ...

logout and log back in as user 'sockx'

make test post with mentions for all users = bug appears
make test comment with mentions for all users = no bug

same test site as before: http://teambox.calebx.com/ (username: sockx; password: peach)

i'm going to try my third approach a few more times tomorrow night. i want to get you as much information as i can.


#11 @careb
11 years ago

i've replicated twice with this process:

1 - use phpmyadmin to drop all Wordpress tables from the database
2 - confirm no tables in database by reloading site (error establishing connection)
3 - confirm no multisite in wp-config.php (open wp-config.php, delete lines for multisite)
4 - reload site = Wordpress five minute install
5 - confirm successful Wordpress install (email received, login works)
6 - confirm default install (default theme, 2014; default plugins)
7 - add 14 test users; one at a time, each with a real email address
8 - promote 14 test users to Author
9 - enable multisite in wp-config.php
10 - configure multisite for Sub-directories in netwrok setup
11 - update wp-config.php and .htaccess for multisite
12 - login again to confirm multisite present and working
13 - install P2 from wp-admin/network/theme-install.php (to have a fresh copy)
14 - network activate P2
15 - set P2 as the theme for the site
16 - reload the site to confirm P2 works
17 - make 1st test post with no users
18 - make 2nd test post with 14 test users mentioned; post works; mentions display correctly; no emails sent as P2 lacks that ability
19 - install BuddyPress from /wp-admin/network/plugin-install.php (to have a fresh copy)
20 - network activate BuddyPress (with default options)
21 - reload site to check test post … bug is present
22 - make 3rd test post with 14 users mentioned; post works; bug is present
23 - turn on all BuddyPress components
24 - reload test posts; bug still present
25 - make 4th test post with 1 test user; post works; no bug; 1 email sent
26 - make 5th test post with 2 test users; post works; no bug; 2 emails sent
27 - make 6th test post with 3 test users; post works; no bug; 3 emails sent
28 - make 7th test post with 4 test users; post works; no bug; 4 emails sent
29 - make 8th test post with 5 test users; post works; no bug; 5 emails sent
30 - make 9th test post with 6 test users; post works; no bug; 6 emails sent
31 - make 10th test post with 7 test user; post works; no bug; 7 emails sent
32 - make 11th test post with 8 test users; post works; no bug; 8 emails sent
33 - make 12th test post with 9 test users; post works; no bug; 9 emails sent
34 - make 13th test post with 10 test users; post works; no bug; 10 emails sent
35 - make 14th test post with 11 test users; post works; bug is present on the 11th test user, the mention is rendered as the second test user (the second user’s name is repeated with an attached zero) like this:

@calebx @tomybot @monkey @chase @soul @mgibb @toeic @happymonkey @happyteacher @comet @tomybot0

only the first 9 test users receive emails

36 - make 15th test post with 12 test users; post works; bug is present on the 11th and 12th test users, the mention is rendered as the second test user (the second user’s name is repeated with an attached numbers incrementing from zero) like this:

@calebx @tomybot @monkey @chase @soul @mgibb @toeic @happymonkey @happyteacher @comet @tomybot0 @tomybot1

only the first 10 test users receive emails

37 - make 16th test post with 13 test users; post works; bug is present on the 11th, 12th, and 13th test users, the mention is rendered as the second test user (the second user’s name is repeated with an attached numbers incrementing from zero) like this:

@calebx @tomybot @monkey @chase @soul @mgibb @toeic @happymonkey @happyteacher @comet@tomybot0 @tomybot1 @tomybot2

only the first 11 test users receive emails

38 - make 17th test post with 14 test users; post works; bug is present on the 11th, 12th, 13th, and 14th test users, the mention is rendered as the second test user (the second user’s name is repeated with an attached numbers incrementing from zero) like this:

@calebx @tomybot @monkey @chase @soul @mgibb @toeic @happymonkey @happyteacher @comet@tomybot0 @tomybot1 @tomybot2 @tomybot3

only the first 12 test users receive emails

same test site: http://teambox.calebx.com/

#12 @DJPaul
11 years ago

Thanks for the details and step-by-step. :) We'll try to run through the same steps soon and see if we can recreate.

#13 @careb
10 years ago

Update:

our server's hard drive failed in June and the whole thing was rebuilt with a new hard drive, new os install, new LAMP stack, latest WordPress (at the time 3.9.2), latest P2 (current), and latest BuddyPress (current) and we are still experiencing thethe same bug.

#14 @DJPaul
10 years ago

  • Milestone changed from Awaiting Review to Future Release
Note: See TracTickets for help on using tickets.