mediaLibraryAdd incorrectly assumes the image field is field_media_image

Created on 3 February 2024, 11 months ago
Updated 17 February 2024, 11 months ago

Image media entities can have image fields named something different besides field_media_image.

The command should be less specific.

Convo from Slack:

Russell:

So the mediaLibraryAdd shrub doesn't work on this recipe/starter unless I update the line
cy.get('input[name="media[0][fields][field_media_image][0][alt]"]').type('alt text');
to
cy.get('input[name="media[0][fields][sa_media_image][0][alt]"]').type('alt text');
Changing field_media_image to sa_media_image
Is there any way we can get around this without having to directly edit the shrub file in the future?

yada yada yada

Paul:

so... here's what i think could work.
cy.get('.media-library-add-form').contains('Alternative text').next().type('alt text')

πŸ› Bug report
Status

Fixed

Component

Commands

Created by

πŸ‡ΊπŸ‡ΈUnited States thejimbirch Cape Cod, Massachusetts

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024