#29013 closed defect (bug) (fixed)
MP3s in Media Library do not open edit modal
Reported by: | ericmann | Owned by: | |
---|---|---|---|
Milestone: | 4.0 | Priority: | normal |
Severity: | normal | Version: | 4.0 |
Component: | Media | Keywords: | has-patch |
Focuses: | Cc: |
Description
Unlike images, documents, and other static media, MP3s are throwing an error in the Media Library when clicked to edit. This JS error means the MP3 will be highlighted, but no modal window is rendered to allow editing meta information about the attachment.
The exact error is:
Uncaught TypeError: Cannot read property 'artist' of undefined
It's triggered on /wp-admin/upload.php?item={item Id}:107
Screenshot of Chrome debugger console attached.
Attachments (4)
Change History (11)
#1
@
10 years ago
- Keywords has-patch added
29013.diff follows the pattern of changeset [29208] by making sure data.artist
and data.album
are defined before trying to use them.
#2
follow-up:
↓ 4
@
10 years ago
- Keywords has-patch removed
- Milestone changed from Awaiting Review to 4.0
Can we do the checks separately so an artist can be shown even if an album isn't? Or are both always defined when one is, just empty?
This also makes me wonder if we can generate ID3 data behind the scenes intelligently - we didn't do it when loading the library in the modal because it could trigger a bunch at once, but maybe there is something we can do further. Previously: #26825.
#4
in reply to:
↑ 2
@
10 years ago
Replying to helen:
Can we do the checks separately so an artist can be shown even if an album isn't? Or are both always defined when one is, just empty?
We can, it'll break the elegance of using a foreach here though. Creating a second patch ...
This also makes me wonder if we can generate ID3 data behind the scenes intelligently - we didn't do it when loading the library in the modal because it could trigger a bunch at once, but maybe there is something we can do further. Previously: #26825.
I would argue something like this would be well-suited for an upgrade routine.
@
10 years ago
As an alternative, let's just be sure all ID3 tags are printed to JS, even if they're empty. This removes the burden of checking against undefined
out of the JS templates (since logic should be abstracted from templates anyway).
Screenshot of error console for reference