Problem/Motivation
Media Library uploads are broken in Safari, due to this error:
Object.values is not an function
Tested with Version 9.1.2 (11601.7.7)
Steps to reproduce:
- Add media reference field that allows image media.
- Upload image through the media library using Safari browser.
- fill in alt text and hit 'Save' button
Expected: Files appear in the media library
Actual: Ajax command fails and new javascript error appears.

Proposed resolution
Object.values isn't supported until Safari 10.3, use forEach or some other iterator.
Remaining tasks
Review/Commit.
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3102572-2.patch | 1.18 KB | oknate |
| upload-fail-media-library.mov | 11.61 MB | oknate | |
| safari-error-2.png | 279.24 KB | oknate |
Comments
Comment #2
oknateI guess I'm using a very old version of Safari:
I'll try to test if this happens on newer version of Safari.
This looks like the only place
Object.valuesis used in core!It was added here: https://www.drupal.org/files/issues/2019-02-17/3023802-55.patch
I'm pretty sure I tested on Safari within the last few months and it worked. So I'm not sure why it would have stopped working.
Comment #3
oknateI tested (without the patch) with Drupal 8.9 and Safari Version 11.1.2 (11605.3.8.1) and it's not a problem on that version. I believe because Object.values was added to Safari in 10.3. So I'm changing the title. I still think this change is possible, and would allow this to work on older versions of Safari, but I don't think it's urgent. I'm reducing the priority of the bug to 'Normal'.
Comment #4
phenaproximaWe might be in the clear; if I'm understanding https://www.drupal.org/docs/8/system-requirements/browser-requirements correctly, only the last two major versions of Safari are supported. I'm running macOS Catalina and Safari is at version 13.
Comment #9
johankleene commentedSupported version > Safari 15, so won't fix. Closing as outdated.