Autosave in combination with the Media library is breaking part of the UX.

When I edit an existing node with a media field that contains an image, and try to delete this image, the Ajax call returns a wrong form.

See the attached screenshots:
1. autosave-media-start This is the start situation, a Media field with an image attached to it. Now press 'Delete' (or 'Verwijderen' in Dutch)
Autosave and Media conflict start

2. autosave-media-after An Ajax call is made that returns the new form for the Media field. The form now wrongly includes a text input, attach button and manage image crops
Autosave and Media conflict

2. autosave-media-intended It should have returned a form that looks like this.
Autosave and Media conflict

I'm not sure whether or not this is a bug in Media or Autosave, but when I disable Autosave it works an intended.

I'm running both Autosave and Media latest versions:
Media 7.x-2.0-alpha4+41-dev and Autosave 7.x-2.2+16-dev

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Koen.Pasman’s picture

Issue summary: View changes
Koen.Pasman’s picture

Issue summary: View changes
Koen.Pasman’s picture

atourino’s picture

This is a small patch I'm using to prevent autosave from crashing Javascript virtual machine when media module is in use.

wjackson’s picture

Status: Active » Reviewed & tested by the community

The patch in #4 works for me!

Updating status to RTBC.

Thanks atourino!

David_Rothstein’s picture

Linking to a possibly related issue.

a.gursoy’s picture

Status: Reviewed & tested by the community » Needs review

Hi, we are using Media Module 7.x-2.0-beta2 and Autosave 7.x-2.2 together.
We applied patch in #4 but it doesn't work for us.

Problem Details:

If image field empty before autosave work. It saves this empty state as image attached. That's why when you click restore, it does not show 'browse' button.Instead, shows 'attach' button even there is no image attached.

Screenshots:
http://prnt.sc/cvst9s
http://prnt.sc/cvstn3