Opened 8 years ago
Closed 8 years ago
#42414 closed defect (bug) (fixed)
Customize: Call to history.replaceState() before DOM ready in customizer preview causes error
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.9 | Priority: | normal |
Severity: | normal | Version: | 4.9 |
Component: | Customize | Keywords: | has-patch commit dev-reviewed |
Focuses: | Cc: |
Description (last modified by )
In 4.9 the injectUrlWithState() function was amended in [41597] with a dependency on a wp.customize.api.settings.changeset.autosave
global. However, injectUrlWithState
can be called prior to DOM ready when that global is populated, and the result is an undefined error. This can be seen in the Picard theme which does history.replaceState()
before the Customizer preview is able to initialize itself. So this dependency on the global needs to be removed.
Attachments (1)
Change History (10)
#1
@
8 years ago
- Keywords has-patch dev-feedback commit added
- Owner set to westonruter
- Status changed from new to accepted
This ticket was mentioned in Slack in #core-committers by westonruter. View the logs.
8 years ago
This ticket was mentioned in Slack in #core by jeffpaul. View the logs.
8 years ago
#6
@
8 years ago
- Keywords dev-reviewed added; dev-feedback removed
I just spent an unreasonably long time trying to setup Picard and reproduce the bug you encountered. And failed.
Patch looks reasonable.
The fix is trivial since the
autosave
flag is already determined via the presence of acustomize_autosaved
query param. Since we're parsing the initial query params already, we just have to re-use them. See 42414.0.diff.