Opened 9 years ago
Closed 5 years ago
#41050 closed defect (bug) (duplicate)
Twenty Seventeen: Cannot read property 'top' of undefined in belowEntryMetaClass
| Reported by: | ericdaams | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Bundled Theme | Version: | 4.8 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: | javascript, template |
Description
I'm seeing this with TwentySeventeen version 1.3 activated:
global.js?ver=1.0:124 Uncaught TypeError: Cannot read property 'top' of undefined at belowEntryMetaClass (global.js?ver=1.0:124) at global.js?ver=1.0:239
It only occurs in the following circumstance:
- You have widgets in the sidebar menu.
- You have a custom template (either defined in your child theme or generated by a plugin) that does not load the sidebar.
If the above are both true, you'll see the error triggered on the window.resize event.
I first encountered this while testing alongside Charitable (create a campaign and then go to donate page), but you can also reproduce by creating a child theme and adding a custom single.php with the sidebar omitted.
Attachments (2)
Change History (7)
#3
@
7 years ago
- Summary Cannot read property 'top' of undefined in belowEntryMetaClass (TwentySeventeen) → Twenty Seventeen: Cannot read property 'top' of undefined in belowEntryMetaClass
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
I've added two patches, either of which resolves this. The second is a little more efficient since it only checks
$sidebar.lengthinstead of also checking for thehas-sidebarbody class. My assumption is that if$sidebar.lengthis false,has-sidebarwill never exist as a body class anyway, so it's a redundant check.