Skip to:
Content

BuddyPress.org

Opened 5 years ago

Last modified 5 years ago

#5922 new defect (bug)

Private Message Sent-to dropdown broken

Reported by: SeeingBlueS2 Owned by:
Milestone: Awaiting Contributions Priority: normal
Severity: normal Version: 2.1
Component: Messages Keywords: needs-patch
Cc:

Description

When sending a private message to someone you are given the option to add recipients to the conversation using the Sent-to field. When typing in that field it will provide a dropdown where you could select the user to populate the field with. This dropdown has stopped working.

I have had no updates. Still using Buddypress 2.1 and WordPress 3.9.2. I tested with all other plugins disabled, I’ve disabled and re-enabled buddypress and tried with Theme TwentyThirteen. I’ve tried different browsers and different computers.

I applied the fix under Javascript issues with the older bp-default theme and this did not resolve my issue. I also downloaded and used the function.php listed here: https://raw.githubusercontent.com/buddypress/BP-Default/619efe8527847266c961fa43775eade42c7ff70d/functions.php and that did not work either.

Still having this problem

Change History (19)

#1 @SeeingBlueS2
5 years ago

  • Cc flanksoft@… added

#2 @boonebgorges
5 years ago

Thanks for the report. Can you provide more details on what you mean by "this dropdown has stopped working"? Exactly what are you doing, what do you expect to see, and what do you actually see?

Try opening your browser's JavaScript console to see if any errors are displayed.

#3 @SeeingBlueS2
5 years ago

Good questions. I expect to see a list of related user names in a drop down as I am typing. Instead there is no drop down. When right-clicking the page, selecting Inspect Element, then choosing Console the only thing I see is:

Use of inputEncoding is deprecated. opt_content.js:1

#4 @boonebgorges
5 years ago

Hm, I'm not able to reproduce. Using TwentyThirteen, I go to http://example.com/members/boone/messages/compose/?r=otheruser&_wpnonce=12345. 'otheruser' shows up as the default "Send To". Begin typing in the "Send To" box. The box pops up.

Either something is preventing the JS from firing (like, it's not loading on the page), or something's happening on the server that's preventing the response from being loaded.

Next thing I'd check is to see whether an AJAX request is actually being sent. Assuming you're using a Webkit browser (Safari or Chrome): Open your Developer Tools; choose the Network tab; hit the little filter icon at the upper left (looks like a funnel); click the XHR filter. Then try typing into the Send To box to trigger an autocomplete. You should see a new POST to admin-ajax.php.

If you do, click on the 'admin-ajax.php' text in the filter window to view more details. Is a response being sent back? What is it? If you don't see a response, check your server's PHP/Apache error logs to see if you can find a server-level issue.

If you don't, view the source of your page to see whether a script called 'jquery.autocompletefb' is being loaded. If it isn't: are you blocking deprecated files from being loaded on your BP installation?

#5 @SeeingBlueS2
5 years ago

I see the request but I am not getting a response. I installed a fresh copy of wordpress 4.0, buddypress and buddypress default data. Tested this feature, it sends the request but I am still not getting a response. My host is godaddy, I am not using the wordpress hosting though. I am using the regular hosting with wordpress installed.

Is this something you guys can contact Godaddy engineers about and hopefully speak with more intelligence than I?

My domain is greatarchitect.us

#6 @boonebgorges
5 years ago

I'm afraid we're not able to do technical support like that, but you should certainly reach out and ask if there is anything showing up in the error logs. Feel free to point them to this ticket for further details.

#7 @SeeingBlueS2
5 years ago

Let me bring this to your attention and tell me what you think. This same type of request is made when adding new members to a group through the dashboard. That works fine, I get a response there and the dropdown appears like it should. If it were my host, wouldn't that have broke as well?

#8 @boonebgorges
5 years ago

The back-end functionality between the two is not identical. FWIW, I'm not claiming that it's your "host" per se; only that the problem appears to be located on the server rather than in the browser. It's possible, for instance, that some set of circumstances is prevailing such that a PHP fatal error is happening, which would explain the lack of AJAX response. However, there are many ways that this might manifest itself, so it's really impossible to guess at. This is the kind of thing that would jump out in an error log. It's possible that your host already provides access to these logs through a control panel - you would have to ask customer support.

#9 @SeeingBlueS2
5 years ago

Ok, I'm really not getting anywhere with this. This is the response I receive from GoDaddy.

"So if you can get more specific info from buddypress as to checking a certain setting or something more specific then we can go from there...however we can't troubleshoot the actual plugin since that's all 3rd party. Like if they say, you need a something enabled in your .user.ini file or something along those lines then you can actually do that on your end."

Basically I've referenced this ticket with two different representatives, we've reviewed my error logs and we cannot find anything related to this issue.

Is there something else I can do or check?

#10 @boonebgorges
5 years ago

Thanks for the update.

Is there something else I can do or check?

Well, at this point, it will really come down to doing some PHP-level debugging. I'm not sure how comfortable you are venturing into this area, but here are some pointers:

  • For AJAX requests, you can either print_r( $value ); die() and check debug stuff in your browser's console, or you can write to error_log().
  • The place to start looking is in the function bp_legacy_theme_ajax_messages_autocomplete_results(), which is located in buddypress/bp-templates/bp-legacy/buddypress-functions.php. Basically, start reading through that function, and see if you can determine through debugging just where the request is failing.

Thanks for your patience, and update this ticket if you're able to figure anything out.

#11 @SeeingBlueS2
5 years ago

Sorry, I don't have the knowledge to follow what you are saying.

I have spent all morning running different monitor plugins and watching firebug console for errors. I did find one thing that was puzzling pertaining to the cookie that is used during this request. Doesn't matter if I'm checking from greatarchitect.us or testenviro.greatarchitect.us where my clean install is located, I keep seeing this same string within the cookie that refers to an old sub-domain test.greatarchitect.us

75129284.1404843181.513.28.utmcsr=test.greatarchitect.us|utmccn=(referral)|utmcmd=referral|utmcct=/support/officers-ranks/

I don't understand why utmcsr is set to test.greatarchitect.us, or why utmcct is set to /support/officers-ranks/

What do those have to do with this request? I hope I am on to something here.

#12 @boonebgorges
5 years ago

Hm - I doubt that this has anything to do with the problem. That said, you could go through and clear any relevant browser cookies, which should get rid of the message.

#13 @SeeingBlueS2
5 years ago

Bummer. You were right.

I think I may have found something though. Try to replicate this issue after disabling the Friend Connections feature. I have no need for this feature and with it disabled it does not limit me to only sending messages to friends.

When I enable the Friend Connections feature the dropdown works again. So I think this bug does exist in Buddypress but only when Friend Connections is disabled.

#14 @boonebgorges
5 years ago

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

Bingo. That's the issue.

The default behavior for the Messages autocomplete is to return results for Friends only. https://buddypress.trac.wordpress.org/browser/tags/2.1/src/bp-templates/bp-legacy/buddypress-functions.php#L1405 However, this results in an error when the Friends component is disabled https://buddypress.trac.wordpress.org/browser/tags/2.1/src/bp-core/bp-core-classes.php#L2649

SeeingBlueS2, for your purposes, the workaround is to manually set autocomplete to "all" instead of "friends". Put the following line in your wp-config.php, anywhere above the "That's it" line:

define( 'BP_MESSAGES_AUTOCOMPLETE_ALL', true );

DJPaul and other devs - The better end-user experience here may be to default to autocomplete_all when Friends is disabled. However, this has potential privacy issues (should you be able to guess at other site members?) and potential scaling issues (autocomplete_all will not perform well with many thousands of users). Do you think we should do anything about this?

#15 @DJPaul
5 years ago

You can "guess" at other members by looking at the members directory, and the new at-mentions query can be used to search any number of users, so those aren't new concerns. For the sake of getting this working, I think showing all users in results would be acceptable, but we need to check if you can already send to any non-friend user (say, if you disable the JS). If you can't, we need to think up another approach.

#16 @boonebgorges
5 years ago

  • Keywords needs-patch added; dev-feedback removed
  • Milestone changed from Awaiting Review to 2.2

Thanks, DJPaul. I think I agree with you, and I'm 99% sure that you can send a private message to anyone if you know their user name. Let's move to 2.2 for testing. The patch to enable autocomplete_all when Friends is disabled will be trivial to write.

#17 @SeeingBlueS2
5 years ago

  • Cc flanksoft@… removed

#18 @dcavins
5 years ago

What is the desired private message behavior? Is it to only allow private messages to friends or is it allow private messages to anyone, but we'd prefer you only send messages to your friends? Or should we make it explicit so that a site admin can choose the behavior? I favor letting the site admin have easy control, since open private messaging tends to be abused by bots.

Scratch this, since it looks like it is already true: I also wondered if we could extend the new mentions API to handle these "send-to" style inputs (would also be useful to plugins like Invite Anyone).

Last edited 5 years ago by dcavins (previous) (diff)

#19 @DJPaul
5 years ago

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