Skip to:
Content

BuddyPress.org

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#3573 closed defect (bug) (no action required)

BP 1.5 - Auto Complete of to: field when sending private message

Reported by: simon_said's profile simon_said Owned by:
Milestone: 1.5 Priority: normal
Severity: normal Version:
Component: Messages Keywords: dev-feedback
Cc:

Description

Installation of BP 1.5 (vs. Beta 3) over top of a vanilla BP ( vs. 1.2.9). Followed the installation wizard... worked great.

When sending a private message the autocomplete does not always fill in correctly. Friends and activity stream has been turned on / off to see if there is any intereference and still no success.

Scenario is…Private messaging does not always autocomplete when clicking on “private message” in the users profile.

User A clicks on the private message button and autocomplete shows correctly
User B clicks on the private message button for USER A and autocomplete shows correctly
User B clicks on the private message button for USER C and autocomplete does NOT show

All of these users have the same role, and being a “friend” with each other has no effect to this scenario.

Here's a link with some feedback from Paul and Boone
http://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/bp-1-5-bugs-with-private-messaging-autocomplete/

Attachments (1)

3573.01.diff (671 bytes) - added by boonebgorges 13 years ago.

Download all attachments as: .zip

Change History (8)

#1 follow-up: @boonebgorges
13 years ago

  • Keywords dev-feedback added; needs-testing removed

The problem arises when the username has periods in it. By default, BuddyPress uses user_nicename (rather than user_login) when referencing users. WordPress does not allow periods in the user_nicename column.

The immediate answer is to put the following in your wp-config.php file, which will solve the problem:

define( 'BP_ENABLE_USERNAME_COMPATIBILITY_MODE', true );

Devs - we could also be a bit more generous in some of our core functions, and be a bit more generous about the distinction between username compatibility mode on and off. See 3573.01.diff for an example of what I mean. FWIW I think that we probably should implement something like 3573.01.diff in any case, since at the moment bp_core_get_userid() is not compatible with _USERNAME_COMPATIBILITY_MODE.

#2 @johnjamesjacoby
13 years ago

Ideally we should switch everything to using WP_User_Query eventually, which is new since 3.1 and does the work for us.

I'm weary to changing this function so late in RC. Maybe introduce a new function specifically for PM's to search both, make it use WP_User_Query, and we can audit this in 1.6.

#3 @johnjamesjacoby
13 years ago

P.S. - Any danger of a user_login and user_nicename being the same and /not/ belong to the same user ID?

Went on a hunt and didn't come up with a definitive yes/no.

If there is absolutely no danger, meaning WordPress core prevents this, then the above patch is probably sound.

Last edited 13 years ago by johnjamesjacoby (previous) (diff)

#4 in reply to: ↑ 1 @DJPaul
13 years ago

Replying to boonebgorges:

Devs - we could also be a bit more generous in some of our core functions, and be a bit more generous about the distinction between username compatibility mode on and off. See 3573.01.diff for an example of what I mean. FWIW I think that we probably should implement something like 3573.01.diff in any case, since at the moment bp_core_get_userid() is not compatible with _USERNAME_COMPATIBILITY_MODE.

Which is why we use bp_is_username_compatibility_mode() alot to switch between bp_core_get_userid() and bp_core_get_userid_from_nicename() appropriately. See something like bp_core_get_userlink_by_username() for a trivial example. Rather than mess with the SQL at this release, it's probably better just adding this sort of conditional in private messaging wherever this problem occurs.
I don't think messing with bp_core_get_userid() is a good idea this late in the game. That could be done separately for 1.6.

Last edited 13 years ago by DJPaul (previous) (diff)

#5 @boonebgorges
13 years ago

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

I don't think we should change anything for 1.5. (Was never suggesting that :) ) BP_ENABLE_USERNAME_COMPATIBILITY_MODE will work fine with the user's original question. And if Paul is right, then bp_core_get_userid() doesn't need to be _USERNAME_COMPAT compatible, because it's not used.

Closing this ticket as invalid. We can catch these things in 1.6 if we refactor for WP_User_Query.

#6 @johnjamesjacoby
13 years ago

  • Milestone changed from Awaiting Review to 1.5
  • Version 1.5 deleted

Moving closed ticket out of Awaiting Review.

#7 @simon_said
13 years ago

thanks for all the help with this

Note: See TracTickets for help on using tickets.