Make WordPress Core

Opened 6 weeks ago

Last modified 3 weeks ago

#52777 new defect (bug)

Editing an empty gallery results in a javascript error

Reported by: Chouby Owned by:
Milestone: 5.8 Priority: normal
Severity: normal Version:
Component: Media Keywords: needs-patch
Focuses: javascript Cc:


How to reproduce?

  1. In the classic editor, create a post with a gallery with one image and save the post.
  2. Go to the media library and delete permanently this image.
  3. Go back editing the previous post. The gallery displays "No items found".
  4. Attempt to edit the gallery and check the browser console.

Here is the error displayed:

Uncaught TypeError: Cannot read property 'args' of undefined
    at n.<anonymous> (media-views.min.js?ver=5.8-alpha-50521:2)
    at f (underscore.min.js?ver=1.8.3:2)

and the trace:

(anonymous)	@	media-views.min.js?ver=5.8-alpha-50521:2
f	@	underscore.min.js?ver=1.8.3:2
setTimeout (async)		
(anonymous)	@	underscore.min.js?ver=1.8.3:2
p	@	backbone.min.js?ver=1.4.0:2
f	@	backbone.min.js?ver=1.4.0:2
c	@	backbone.min.js?ver=1.4.0:2
n.trigger	@	backbone.min.js?ver=1.4.0:2
(anonymous)	@	media-models.min.js?…r=5.8-alpha-50521:2
c	@	load-scripts.php?c=0…r=5.8-alpha-50521:2
fireWith	@	load-scripts.php?c=0…r=5.8-alpha-50521:2
(anonymous)	@	wp-util.min.js?ver=5.8-alpha-50521:2
c	@	load-scripts.php?c=0…r=5.8-alpha-50521:2
fireWith	@	load-scripts.php?c=0…r=5.8-alpha-50521:2
l	@	load-scripts.php?c=0…r=5.8-alpha-50521:2
(anonymous)	@	load-scripts.php?c=0…r=5.8-alpha-50521:2
load (async)		
send	@	load-scripts.php?c=0…r=5.8-alpha-50521:2
ajax	@	load-scripts.php?c=0…r=5.8-alpha-50521:2
s.ajax.s.ajax	@	load-scripts.php?c=0…r=5.8-alpha-50521:5
(anonymous)	@	wp-util.min.js?ver=5.8-alpha-50521:2
s.Deferred.s.Deferred	@	load-scripts.php?c=0…r=5.8-alpha-50521:5
send	@	wp-util.min.js?ver=5.8-alpha-50521:2
sync	@	media-models.min.js?…r=5.8-alpha-50521:2
fetch	@	backbone.min.js?ver=1.4.0:2
more	@	media-models.min.js?…r=5.8-alpha-50521:2
more	@	media-models.min.js?…r=5.8-alpha-50521:2
edit	@	media-editor.min.js?…r=5.8-alpha-50521:2
edit	@	mce-view.min.js?ver=5.8-alpha-50521:2
edit	@	mce-view.min.js?ver=5.8-alpha-50521:2
onclick	@	plugin.min.js?wp-mce-49110-20201110:1
c.fire	@	tinymce.min.js?ver=49110-20201110:2
fire	@	theme.min.js?wp-mce-49110-20201110:1
o	@	theme.min.js?wp-mce-49110-20201110:1
C	@	tinymce.min.js?ver=49110-20201110:2
d	@	tinymce.min.js?ver=49110-20201110:2

Change History (3)

This ticket was mentioned in Slack in #core-media by antpb. View the logs.

6 weeks ago

#2 @antpb
6 weeks ago

  • Milestone changed from Awaiting Review to 5.8

Adding this to 5.8 so we can investigate further and work towards solving this. Thank you for your report!

#3 @Hareesh Pillai
3 weeks ago

  • Keywords needs-patch added

Thanks for the bug report, @Chouby.

Underscore library was updated in #45785. However, the error still persists.
I'm able to reproduce this error before and after the update.

Note: See TracTickets for help on using tickets.