Skip to:
Content

BuddyPress.org

Opened 9 years ago

Closed 9 years ago

#6939 closed defect (bug) (fixed)

autocomplete missing css

Reported by: modemlooper's profile modemlooper Owned by: imath's profile imath
Milestone: 2.5.1 Priority: high
Severity: major Version: 2.5.0
Component: Messages Keywords: commit
Cc:

Description

The autocomplete function to add css is bad.

There is a missing e in {$url}autocomplete/jquery.autocompletfb{$min}.css and it doesn't load.

Why is this using wp_head?

Could only get it to work by changing to this:

function messages_add_autocomplete_css() {
        if ( bp_is_messages_component() && bp_is_current_action( 'compose' ) ) {
                $min = bp_core_get_minified_asset_suffix();
                $url = buddypress()->plugin_url . 'bp-messages/css/';
                wp_register_style( 'bp-messages-autocomplete', "{$url}autocomplete/jquery.autocompletefb{$min}.css", array(), bp_get_version() );
                wp_enqueue_style( 'bp-messages-autocomplete' );
                wp_style_add_data( 'bp-messages-autocomplete', 'rtl', true );
                if ( $min ) {
                        wp_style_add_data( 'bp-messages-autocomplete', 'suffix', $min );
                }
                wp_print_styles();
        }
}
add_action( 'wp_enqueue_scripts', 'messages_add_autocomplete_css' );

Attachments (1)

6939.patch (716 bytes) - added by imath 9 years ago.

Download all attachments as: .zip

Change History (9)

#2 @modemlooper
9 years ago

Styles are included in the year stylesheets

#3 @imath
9 years ago

  • Milestone changed from 2.5 to 2.5.1

Hi,

thanks for your feedback, just to be sure : the year stylesheet === companion stylesheet ?

@imath
9 years ago

#4 @imath
9 years ago

Looks like the style is not enqueued at all actually. So i've changed wp_register_style in favor of wp_enqueue_style and fixed the missing e.

#5 @hnla
9 years ago

Styles are included in the year stylesheets

Yes can we clarify this somewhat cryptic remark :)

Best to refer to year sheets as companion styles as that's the name that has stuck (maybe not the best but...)

If there are styles corresponding to autocomplete in companion sheets then they will be or are supposed to be where corrections were needed for a given twenty* theme rather than all required styles, he said off top of head.

#6 @DJPaul
9 years ago

  • Keywords commit added; dev-feedback removed

It was enqueued (and registered) in 2.4 in bp_core_register_deprecated_styles() and when it got changed in 2.5, we forgot to swap this register for an enqueue.

The typo in the filename is new in 2.5.

Good patch, ready to commit.

#7 @imath
9 years ago

In 10629:

Make sure the style for the Private Messages autocomplete UI is enqueued.

  • Use wp_enqueue_style() instead of wp_register_style()
  • fix a typo in the stylesheet filename.

See #6939 (branch 2.5)

#8 @imath
9 years ago

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

In 10630:

Make sure the style for the Private Messages autocomplete UI is enqueued.

  • Use wp_enqueue_style() instead of wp_register_style()
  • fix a typo in the stylesheet filename.

Fixes #6939 (trunk)

Note: See TracTickets for help on using tickets.