[wp-trac] [WordPress Trac] #53512: JS errors when displaying legacy widgets using Twenty Seventeen theme
WordPress Trac
noreply at wordpress.org
Mon Jun 28 23:20:50 UTC 2021
#53512: JS errors when displaying legacy widgets using Twenty Seventeen theme
--------------------------+---------------------
Reporter: Boniu91 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 5.8
Component: Widgets | Version:
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
--------------------------+---------------------
Changes (by Clorith):
* keywords: needs-patch => has-patch
Comment:
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).
[attachment:"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.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/53512#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list