WordPress.org

Make WordPress Core

Opened 7 months ago

Closed 6 months ago

#39100 closed defect (bug) (fixed)

Customize: Edit shortcuts do not work if page hasn't been saved and published

Reported by: davidakennedy Owned by: westonruter
Milestone: 4.7.1 Priority: normal
Severity: normal Version: 4.7
Component: Customize Keywords: has-patch commit fixed-major
Focuses: Cc:

Description

This may not be possible to fix given the workflow, but it seemed like an issue.

In Twenty Seventeen:

  1. Go to Customizer — Theme Options.
  2. Make a new page (for a section).
  3. Click on the edit icon for that new page/section.
  4. Edit icon doesn’t do anything.
  5. Click edit icon for existing page. That one works.

This makes some sense because the new page isn't saved and published yet, but it seems like the preview should still work with the page.

Reproduced by myself, @laurelfulford and @melchoyce.

Attachments (1)

39100.diff (677 bytes) - added by sirbrillig 7 months ago.
Attach edit shortcut click handler before shortcut is added

Download all attachments as: .zip

Change History (9)

#1 @westonruter
7 months ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 4.7.1
  • Owner set to sirbrillig
  • Status changed from new to assigned

@sirbrillig can you assist with debugging this? It seems like the click handler is getting lost when the homepage section is refreshed.

#2 @sirbrillig
7 months ago

Looking into it. Definitely the click handler is not being added when a page section is refreshed. The following patch seems to fix the issue in my tests, which is a little odd. The patch just adds the click handler before the button is appended to the page. Since the reference should be maintained I don't know why that would work but my tests showed that the handler wasn't being removed; it looked like it was just not being added.

@sirbrillig
7 months ago

Attach edit shortcut click handler before shortcut is added

#3 @sirbrillig
7 months ago

  • Keywords has-patch added; needs-patch removed

This ticket was mentioned in Slack in #core-customize by celloexpressions. View the logs.


7 months ago

#5 @celloexpressions
7 months ago

  • Keywords commit added
  • Owner changed from sirbrillig to westonruter
  • Status changed from assigned to reviewing

Confirmed that 39100.diff works. Odd, but very unlikely to cause other issues, so let's get it in.

#6 @westonruter
7 months ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 39581:

Customize: Prevent edit shortcut from losing event handler after selective refresh.

Props sirbrillig.
See #27403.
Fixes #39100.

#7 @westonruter
7 months ago

  • Keywords fixed-major added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for 4.7.1.

#8 @dd32
6 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 39606:

Customize: Prevent edit shortcut from losing event handler after selective refresh.

Props sirbrillig.
Merges [39581] to the 4.7 branch.
See #27403.
Fixes #39100.

Note: See TracTickets for help on using tickets.