Make WordPress Core

Opened 6 years ago

Last modified 5 years ago

#35878 closed defect (bug)

In `wp.media.view.Attachment.render` tested parameter is missing a default. — at Version 1

Reported by: georgestephanis Owned by:
Milestone: Priority: lowest
Severity: minor Version: 4.2
Component: Media Keywords: has-patch 2nd-opinion
Focuses: javascript Cc:

Description (last modified by georgestephanis)

I'm still familiarizing myself with Media, so please feel free to just close/wontfix if this is silly.

On line ~116 in wp-includes/js/media/views/attachment.js we're testing:

if ( options.nonces ) {

but options.nonces isn't initialized above in the options defaults.

For clarity's sake, should we initialize it to false? (also, it keeps my IDE from getting cranky about it)

Patch attached.

Also -- options.percent isn't initialized either -- but as that seems to be conditionally initialized down below (only initialized if options.uploading is truthy), I didn't muck around with it in this patch.

Change History (2)

#1 @georgestephanis
6 years ago

  • Description modified (diff)
  • Summary changed from In `wp.media.view.Attachment.render` tested parameter is missing an initialization. to In `wp.media.view.Attachment.render` tested parameter is missing a default.
Note: See TracTickets for help on using tickets.