Make WordPress Core

Opened 3 years ago

Last modified 18 months ago

#52777 new defect (bug)

Editing an empty gallery results in a javascript error

Reported by: chouby's profile Chouby Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Media Keywords: needs-patch reporter-feedback needs-testing-info
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	@	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 (5)

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

3 years ago

#2 @antpb
3 years 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 years 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.

#4 @JeffPaul
3 years ago

  • Milestone changed from 5.8 to Future Release

With 5.8 Beta 1 next week and no patch/PR on this ticket, I'm going to punt this to Future Release. Once a patch/PR is available this ticket can be added back to a numbered milestone.

#5 @Mista-Flo
18 months ago

  • Keywords reporter-feedback needs-testing-info added

I'm not sure I understood steps 3 and 4, I went back to the post, either edit the broken attachment or try to open the media library through add media button but it doesn't output any error, it's just an empty library. (tested on trunk)

Note: See TracTickets for help on using tickets.