WordPress.org

Make WordPress Core

Opened 4 weeks ago

Last modified 8 days ago

#51425 new defect (bug)

Customizer Restore Autosave Notice dismiss function is not called

Reported by: karthikbhatb Owned by:
Milestone: 5.6 Priority: normal
Severity: normal Version: 5.5
Component: Customize Keywords: has-patch needs-testing
Focuses: ui, javascript Cc:

Description

After 5.5.1 upgrade dismissAutosave function is not being called on notice dismissal for recent Autosave Notice (Under customize-control.js).
An extra .notice-dismiss button is added under common.js

Fix: Check if the .notice-dismiss already exists under the notice element.

Change History (4)

This ticket was mentioned in PR #560 on WordPress/wordpress-develop by karthikax.


4 weeks ago

  • Keywords has-patch added

After 5.5.1 upgrade dismissAutosave function is not being called on notice dismissal for recent Autosave Notice (Under customize-control.js).
An extra .notice-dismiss button is added under common.js

Fix: Check if the .notice-dismiss already exists under the notice element.

Trac ticket: https://core.trac.wordpress.org/ticket/51425

#2 @SergeyBiryukov
2 weeks ago

  • Component changed from General to Customize
  • Keywords needs-testing added
  • Milestone changed from Awaiting Review to 5.6

Hi there, welcome to WordPress Trac! Thanks for the ticket and the patch.

It would be great to have the steps to reproduce the issue on a clean install, and to also track down which change caused the regression.

#3 @karthikbhatb
10 days ago

Hi,

Thanks for tidying up the ticket.

Steps to reproduce the issue:

  1. Install fresh WordPress 5.5.1
  2. Navigate to wp-admin/customize.php
  3. Make any change/s (do not hit publish / do not save)
  4. Reload the page (confirm reload by clicking the reload alert button)
    • This gives the following notice: There is a more recent autosave of your changes than the one you are previewing. Restore the autosave
  5. Try to dismiss the notice. Notice disappears, but notice area doesn't collapse
  6. Reload the page. The notice appears once again, expected behavior would be to not see the notice again.

I could not track down what changes caused the issue (tried with trac. any help/link on how to do this for the future is appreciated.)

Anyway, what I found is that the notice dismissal and admin ajax call on .notice-dismiss is already handled in https://core.trac.wordpress.org/browser/trunk/src/js/_enqueues/wp/customize/base.js#L912 and
https://core.trac.wordpress.org/browser/trunk/src/js/_enqueues/wp/customize/controls.js#L8360

It would not make sense for makeNoticesDismissible in https://core.trac.wordpress.org/browser/trunk/src/js/_enqueues/admin/common.js#L1092 to override that.

Let me know if there is more to it.

#4 @dlh
8 days ago

  • Version set to 5.5

Confirmed that this was working as expected in 5.4; assigning the version accordingly. I'm not sure yet where it broke, though.

Note: See TracTickets for help on using tickets.