Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#34294 closed defect (bug) (fixed)

Session storage autosave notice displayed in the wrong place

Reported by: afercia Owned by: iseulde
Priority: normal Milestone: 4.4
Component: Administration Version: 4.3
Severity: normal Keywords: has-patch has-screenshots
Cc: Focuses: ui, javascript

Description

The main heading in the admin screens is now a H1 and we missed to update the jQuery selector used for appending the Session storage autosave notice. It's still $('.wrap h2').first() so the notice gets appended after the first H2 in the page :)

https://cldup.com/Uw9RGEZUTc.png

Attachments (4)

34294.patch (554 bytes ) - added by afercia 11 years ago.
34294.2.patch (544 bytes ) - added by afercia 11 years ago.
34294.3.patch (1.4 KB ) - added by iseulde 11 years ago.
34294.4.patch (1.5 KB ) - added by iseulde 11 years ago.

Download all attachments as: .zip

Change History (18)

@afercia
11 years ago

#1 @afercia
11 years ago

  • Keywords has-patch added

In the proposed patch:

  • After [32974], use a proper jQuery selector for the session storage autosave notice.

#2 @DrewAPicture
11 years ago

  • Keywords needs-screenshots added

#3 @afercia
11 years ago

  • Keywords has-screenshots added; needs-screenshots removed

Screenshot with patch applied:

https://cldup.com/uDVxv8OU3r.png

This ticket was mentioned in Slack in #core-editor by afercia. View the logs.


11 years ago

#5 @afercia
11 years ago

As per @iseulde suggestion, will try to use $( '#post' ).before() in a new patch, Side note, will try to do the same for the back-compat in common.js introduced in [32974], will open a separate ticket.

@afercia
11 years ago

#6 @afercia
11 years ago

Refreshed patch to use better jQuery, previous implementation:

$( '.wrap h1' ).first().after( $notice.addClass( 'notice-warning' ).show() );

new one:

$( '#post' ).before( $notice.addClass( 'notice-warning' ).show() );

Any thoughts and testing more than welcome :)

@iseulde
11 years ago

#7 @iseulde
11 years ago

Don't think we need to exclude the ones that are already correctly positioned, it makes the query easier.

#8 @SergeyBiryukov
11 years ago

  • Milestone Awaiting Review4.4

#9 @afercia
11 years ago

@iseulde your approach makes sense but I'm afraid it will work just on some admin screens. Plugins may have screens where the first form element inside .wrap is not exactly in the place you would expect :(

https://cldup.com/cXCyWUguNs.png

#10 @afercia
11 years ago

I'd propose to split the issues and keep this ticket just for the session storage notice. Since it's used when editing posts, I think we can rely on the presence of $( '#post' ) ? Any thoughts welcome.

This ticket was mentioned in Slack in #core-editor by afercia. View the logs.


11 years ago

@iseulde
11 years ago

#12 @iseulde
11 years ago

  • Owner set to iseulde
  • Resolutionfixed
  • Status newclosed

In 35238:

Admin: fix repositioning notices

Fixes #34294.
Props afercia.

#13 @stephenharris
11 years ago

The current patch breaks backwards compatibility with plug-ins using .below-h2 class to keep alerts in-line.

Since we're using H1 tags for pages and not H2 the class .below-h2 doesn't make much sense - but I just wanted to raise the above compatibility issue in case the break was unintentional. We could exclude divs with .inline or .below-h2.

Any thoughts?

#14 @afercia
11 years ago

In 35516:

Admin: Ensure notices with the below-h2 class are not repositioned after [35238].

Keeps the .below-h2 class for backwards compatibility with plugins that are (incorrectly) using it. Plugins should use .inline instead.

Props stephenharris.
Fixes #34570. See #34294.

Note: See TracTickets for help on using tickets.