Problem:

Uploading a new image on a Media Image ajax form fails.

Steps to reproduce:

  • Enable media_library module
  • Set image widget to media library on a node's media image field
  • Put a check in the Media checkbox on the Gatsby admin form under "Entity types to send to Gatsby Preview Server"
  • Create/edit node and use the media image ajax form to upload a new image (note: selecting an existing image works just fine)
  • After entering the alt text, click the save button; the form doesn't exit as it should, and there is an ajax error in the browser's console

I've traced the error through a debugger, and found that the form doesn't finish processing correctly after the POST to the Gatsby Preview server in GatsbyPreview->updatePreviewEntity.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rrrob created an issue. See original summary.

codekarate’s picture

Assigned: Unassigned » codekarate

This is an upstream issue with jsonapi_extras entityToJsonApi as I reported in https://www.drupal.org/project/jsonapi_extras/issues/3135950

I have an in progress workaround that should be released to the dev version of the module shortly.

  • codekarate committed cade56e on 8.x-1.x
    Issue #3129452: Saving new file on Media entity fails
    
codekarate’s picture

Status: Active » Fixed

This is working in the newest dev version of the module and will included in the next release.

codekarate’s picture

Status: Fixed » Closed (fixed)
codekarate’s picture

Status: Closed (fixed) » Needs work

There are still some entity bundling issues.

scottalan’s picture

I will be uploading a patch soon that should fix the entity bundling issues mentioned.

scottalan’s picture

scottalan’s picture

Status: Needs work » Needs review

I botched the patch name. It should use 3129452 for the issue id. I can easily update this if necessary

Edit: I'll be uploading a new patch as it does not apply, should have tested that first.

Edit: The patch does apply cleanly when applying directly but with composer...not so much. Stand by...

scottalan’s picture

  • codekarate committed a0237b8 on 8.x-1.x authored by scottalan
    Issue #3129452 by scottalan, codekarate: Saving new file on Media entity...
codekarate’s picture

Status: Needs review » Reviewed & tested by the community

This has been committed to dev and is working for my tests.

codekarate’s picture

Status: Reviewed & tested by the community » Fixed
codekarate’s picture

Status: Fixed » Closed (fixed)