Opened 7 years ago
Closed 7 years ago
#42330 closed defect (bug) (fixed)
Customizer errors when control is associated with non-existing section
Reported by: | prajaktag | Owned by: | westonruter |
---|---|---|---|
Milestone: | 4.9 | Priority: | normal |
Severity: | normal | Version: | 4.9 |
Component: | Customize | Keywords: | has-patch |
Focuses: | Cc: |
Description (last modified by )
Get this js error while creating new menu from themes customiser - Uncaught TypeError: Cannot read property 'open' of undefined
Here is screenshot - https://goo.gl/gVaxBU
- Uncaught TypeError: Cannot read property 'open' of undefined
The theme is One Page X with beta 3 wordpress.
Attachments (1)
Change History (10)
#4
@
7 years ago
The reason for the error is that theme is doing $wp_customize->remove_section( 'header_image')
and $wp_customize->add_section( 'background_image')
, but it is not subsequently changing the section
for the controls that were in the header_image
section. So the background_repeat
control is getting added to the Customizer without a containing section. Because of this, the embedded
deferred is never resolved because of this: https://github.com/WordPress/wordpress-develop/blob/a33d615/src/wp-admin/js/customize-controls.js#L3578-L3590
And since the control.linkElements()
is currently being called once embedded
is deferred, the elements
then never get created. And this is why the error is happening.
#5
@
7 years ago
- Summary changed from JS error while adding new item to menu using theme customiser. to Customizer errors when control is associated with non-existing section
#6
@
7 years ago
- Keywords has-patch needs-testing added
- Owner set to westonruter
- Status changed from new to accepted
The error when attempting to add a nav menu item is probably a side effect of the first error related to
unsync
being undefined.