Make WordPress Core

Opened 7 years ago

Closed 3 years ago

#41050 closed defect (bug) (duplicate)

Twenty Seventeen: Cannot read property 'top' of undefined in belowEntryMetaClass

Reported by: ericdaams's profile ericdaams Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.8
Component: Bundled Theme Keywords:
Focuses: javascript, template Cc:

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)

41050.patch (620 bytes) - added by ericdaams 7 years ago.
41050.2.patch (583 bytes) - added by ericdaams 7 years ago.

Download all attachments as: .zip

Change History (7)

@ericdaams
7 years ago

@ericdaams
7 years ago

#1 @ericdaams
7 years ago

I've added two patches, either of which resolves this. The second is a little more efficient since it only checks $sidebar.length instead of also checking for the has-sidebar body class. My assumption is that if $sidebar.length is false, has-sidebar will never exist as a body class anyway, so it's a redundant check.

#2 @williampatton
6 years ago

  • Component changed from Themes to Bundled Theme

#3 @nielslange
5 years ago

  • Summary changed from Cannot read property 'top' of undefined in belowEntryMetaClass (TwentySeventeen) to Twenty Seventeen: Cannot read property 'top' of undefined in belowEntryMetaClass

#4 @sabernhardt
3 years ago

Sorry the ticket did not receive more attention earlier.

This looks like the issue on #53512, which was just fixed for WordPress 5.8. Please verify whether it works now.

#5 @sabernhardt
3 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

I was hoping for confirmation that the issue is fixed now, but I'll close the ticket as a duplicate of #53512.

If I'm wrong (about this) and the problem still occurs, please reopen the ticket.

Note: See TracTickets for help on using tickets.