#53512 closed defect (bug) (fixed)
Twenty Seventeen: JS errors when displaying legacy widgets
Reported by: | Boniu91 | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.8 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Bundled Theme | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
WordPress 5.8-beta3-51230
Browser 91.0.4472.114
Theme Twenty Seventeen
Steps to reproduce:
- Downgrade to 5.7.x WordPress using the Beta Tester plugin
- Add a couple of widgets, make sure that Image widget is also added
- Upgrade to 5.8-beta
- Go to the Appearance > Widgets area and open JS console, see errors
- Click on the legacy Image widget, see another error
Attachments (2)
Change History (12)
#2
@
4 years ago
- Keywords needs-patch added
I've been able to reproduce this one, and it seems to happen when any widgets are found in sidebars, not just the Image widget.
This ticket was mentioned in Slack in #core by jeffpaul. View the logs.
4 years ago
#4
@
4 years ago
- Keywords has-patch added; needs-patch removed
This appears to be related to the assets/js/global.js
file in the theme, which expects markup to exist on the page if sidebars are defined, but that markup is missing since only the widget it self and headers/footers of the page are loaded in the iframe used to display legacy widgets (widgets added prior to WordPress 5.8).
53512.patch ensures the $sidebar
variable is defined, and as it returns a jQuery array of objects (as it is defined using .find()
), it also checks that there is at least one entry in that array. If neither of these cases ring true, it will return without trying to perform manipulations on the meta area of the theme.
#5
@
4 years ago
- Keywords commit added
Thanks @Clorith! I think 53512.patch makes sense. Marking for commit.
#6
@
4 years ago
- Component changed from Widgets to Bundled Theme
- Summary changed from JS errors when displaying legacy widgets using Twenty Seventeen theme to Twenty Seventeen: JS errors when displaying legacy widgets
Moving to the milestone to investigate.