Skip to:
Content

BuddyPress.org

Opened 8 years ago

Closed 8 years ago

#6740 closed defect (bug) (fixed)

BP_IGNORE_DEPRECATED and the message component

Reported by: wpdennis's profile wpdennis Owned by: boonebgorges's profile boonebgorges
Milestone: 2.5 Priority: normal
Severity: normal Version: 2.1
Component: Messages Keywords: needs-patch
Cc: mail@…

Description

The autocomplete feature for composing messages is deprecated. With BP_IGNORE_DEPRECATED defined it isn't loaded anymore.

But if the autocomplete style isn't loaded, at least list-style: none; is missing and the input field is indented with a disc.

I think the needed styles for the form, that are independent from autocomplete, should be moved to buddypress.css instead of jquery.autocompletefb.css.

Additionally, there is JS-Code injected via messages_autocomplete_init_jsblock() that calls "autoCompletefb" on document ready as reported in #6212, which brings up:

Uncaught TypeError: jQuery(...).autoCompletefb is not a function

Change History (8)

#2 follow-up: @boonebgorges
8 years ago

Why was the autocomplete feature deprecated? Just because we don't like the implementation? I think the fix here and #6212 is to undeprecate.

#3 @wpdennis
8 years ago

  • Cc mail@… added

Yeah, that would resolve the issues. Anyway, I still think the needed styles to format the form should be independent from autocomplete.

As a side note: Before 2.4.0 I haven't had this issue but I'm not sure whether there were CSS changes in 2.4.0 or this was because of some customizing on my end that stopped working now.

In case someone needs to fix this too, this worked for me:

add_action( 'wp_head', function() {
	if ( bp_is_messages_component() and bp_is_current_action( 'compose' ) ):
		echo '<style>ul.acfb-holder{padding:0;list-style:none}</style>';
	endif;
} );

#4 in reply to: ↑ 2 @DJPaul
8 years ago

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

Replying to boonebgorges:

Why was the autocomplete feature deprecated?

I did this in r8559 because I think I was going to rewrite the message recipients field autocomplete using the new scripts we introduced for the at-messages. Since that never happened, I see no harm in un-deprecating this for now.

#5 @boonebgorges
8 years ago

If BP did something in 2.4 to mess up styling, I'd be curious to know what it is - it could potentially be something to fix in 2.4.1. Anyone game for a bisect?

#6 follow-up: @r-a-y
8 years ago

  • Version set to 2.1

It's due to r8559. We enqueue the 'bp-messages-autocomplete' CSS, but the CSS is never registered if BP_IGNORE_DEPRECATED is set to true.

If we undeprecate jQuery autocomplete, everything should work again.

Or, we can do what DJPaul wanted and that is use the new BP_Members_Suggestions class to power message autocomplete.

Before 2.4.0 I haven't had this issue but I'm not sure whether there were CSS changes in 2.4.0 or this was because of some customizing on my end that stopped working now.

Not sure why you never had this issue in BP 2.4.0, wpdennis. Must be something custom? What theme are you using? If you're using one of the WordPress Twenty themes, we do have some CSS styles specific to autocomplete. Maybe we changed something there? I need to take a closer look to be sure.

#7 in reply to: ↑ 6 @wpdennis
8 years ago

Replying to boonebgorges:

If BP did something in 2.4 to mess up styling, I'd be curious to know what it is - it could potentially be something to fix in 2.4.1.


Replying to r-a-y:

Not sure why you never had this issue in BP 2.4.0, wpdennis.

My bad, I'm sorry.

I digged a little bit deeper and I think the issue was there way before BP 2.4. I just haven't noticed it in my tests before and I probably only answered existing conversations in production (without composing some myself) - so I've never seen the issue before.

I tried one installation with a backup from BP 2.3.2.1 and there I had the same issue.

Replying to r-a-y:

If we undeprecate jQuery autocomplete, everything should work again.

Yes it would.

While trying a few things I noticed that "ul.acfb-holder li.friend-tab" needs some styling, too, if recipients are added (e.g. by clicking on the #send-private-message button in a profile).

This is really minor, but I think the <ul> should have a neutral class (like .bp-recipients or something) and the ul styles from jquery.autocompletefb.css should move to buddypress.css (or could be injected via inline css only on the composing screen).

The styling is needed with and without autocompletefb.

#8 @boonebgorges
8 years ago

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

In 10446:

Undeprecate Messages autocomplete scripts and styles.

These assets were deprecated in [8559], with the intention of rewriting the
functionality using BP_Suggestions. Until that rewrite happens, let's bring
them back from the dead.

Fixes #6740.

Note: See TracTickets for help on using tickets.