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.
safari errors preventing upload in media library

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

Comments

oknate created an issue. See original summary.

oknate’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new1.18 KB

I guess I'm using a very old version of Safari:

First version of safari 10 was released in September 20, 2016 and last version 10.1. 2 was released on July 19, 2017.

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.

oknate’s picture

Title: Media Library upload broken in Safari » Media Library upload broken in Safari versions less than 10.3
Priority: Major » Normal

I 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'.

phenaproxima’s picture

We 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.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

johankleene’s picture

Status: Needs review » Closed (outdated)
Issue tags: +Bug Smash Initiative

Supported version > Safari 15, so won't fix. Closing as outdated.