Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mediaLibraryAdd incorrectly assumes the image field is field_media_image #24

Merged
merged 1 commit into from
Feb 3, 2024

Conversation

thejimbirch
Copy link
Contributor

https://www.drupal.org/project/shrubs/issues/3419010

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')`

@thejimbirch thejimbirch merged commit bc5c1d7 into main Feb 3, 2024
@thejimbirch thejimbirch deleted the bug/3419010-mediaLibraryAdd branch February 3, 2024 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant