Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#34294 closed defect (bug) (fixed)

Session storage autosave notice displayed in the wrong place

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


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 :)

Attachments (4)

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

Download all attachments as: .zip

Change History (18)

9 years ago

#1 @afercia
9 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
9 years ago

  • Keywords needs-screenshots added

#3 @afercia
9 years ago

  • Keywords has-screenshots added; needs-screenshots removed

Screenshot with patch applied:

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

9 years ago

#5 @afercia
9 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.

9 years ago

#6 @afercia
9 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 :)

9 years ago

#7 @iseulde
9 years ago

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

#8 @SergeyBiryukov
9 years ago

  • Milestone changed from Awaiting Review to 4.4

#9 @afercia
9 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 :(

#10 @afercia
9 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.

9 years ago

9 years ago

#12 @iseulde
9 years ago

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

In 35238:

Admin: fix repositioning notices

Fixes #34294.
Props afercia.

#13 @stephenharris
9 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
9 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.