Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#53488 closed defect (bug) (fixed)

The `action` passed to jQuery.ajax is possibly `null`

Reported by: ixkaito's profile ixkaito Owned by: desrosj's profile desrosj
Milestone: 5.8 Priority: normal
Severity: normal Version:
Component: Widgets Keywords: has-patch commit
Focuses: javascript Cc:


When I add widgets from the Customizer, the console displays a TypeError action is null. Need to check if action and exist.

Attachments (2)

2021-06-23 17.34.37.png (1019.0 KB) - added by ixkaito 3 years ago.
53488.diff (520 bytes) - added by ixkaito 3 years ago.

Download all attachments as: .zip

Change History (10)

3 years ago

#1 @noisysocks
3 years ago

  • Milestone changed from Awaiting Review to 5.8

#2 @noisysocks
3 years ago

Why is data null? Perhaps @wordpress/customize-widgets is doing something wrong cc. @kevin940726.

#3 @ixkaito
3 years ago

@noisysocks I'm not sure data is possibly null. Just to be safe.

#4 @zieladam
3 years ago

It seems like action is explicitly set to null here:

That code hasn't changed for last 5 years so it sounds like we're just triggering an unhappy path introduced in this commit:

Given that context, the fix looks good to me.

Last edited 3 years ago by zieladam (previous) (diff)

#5 @zieladam
3 years ago

  • Keywords commit added

#6 @desrosj
3 years ago

Thanks all! Just for cross-referencing in Trac, introduced in [51187].

#7 @desrosj
3 years ago

  • Owner set to desrosj
  • Resolution set to fixed
  • Status changed from new to closed

In 51238:

Widgets: Avoid a TypeError when adding a widget in the Customizer.

This fixes a bug where action is set to null when adding a widget in the Customizer.

Fixes #53488. See #53421, #53419.

#8 @desrosj
3 years ago

Just realized I forgot to include props on the commit here. My apologies!

I just double checked, and everyone on the ticket has already received props for the 5.8 release, so you'll all be included in the release credits.

Note: See TracTickets for help on using tickets.