Make WordPress Core

Opened 10 years ago

Closed 10 years 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
Priority: normal Milestone: 4.7.1
Component: Customize Version: 4.7
Severity: normal Keywords: has-patch commit fixed-major
Cc: Focuses:

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 10 years ago.
Attach edit shortcut click handler before shortcut is added

Download all attachments as: .zip

Change History (9)

#1 @westonruter
10 years ago

  • Keywords needs-patch added
  • Milestone Awaiting Review4.7.1
  • Owner set to sirbrillig
  • Status newassigned

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

#2 @sirbrillig
10 years 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
10 years ago

Attach edit shortcut click handler before shortcut is added

#3 @sirbrillig
10 years ago

  • Keywords has-patch added; needs-patch removed

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


10 years ago

#5 @celloexpressions
10 years ago

  • Keywords commit added
  • Owner changed from sirbrillig to westonruter
  • Status assignedreviewing

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

#6 @westonruter
10 years ago

  • Resolutionfixed
  • Status reviewingclosed

In 39581:

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

Props sirbrillig.
See #27403.
Fixes #39100.

#7 @westonruter
10 years ago

  • Keywords fixed-major added
  • Resolution fixed
  • Status closedreopened

Reopening for 4.7.1.

#8 @dd32
10 years ago

  • Resolutionfixed
  • Status reopenedclosed

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.