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

Update card media deprecation to check both src and attributes.src #2585

Merged
merged 1 commit into from
Dec 7, 2022

Conversation

remydenton
Copy link
Collaborator

Jira

https://pegadigitalit.atlassian.net/browse/DS-903

Summary

Fixes deprecation logic for image in cards

Details

#2520 introduced a check for usage of the deprecated image component.

The check didn't take into account the possibility that a src prop could be passed either directly or as attributes.src. In the later case, the logic incorrectly assumed that a render array was being passed rather than structured data.

Ultimately, this should be fixed on the Drupal side, but this update fixes the break.

How to test

On a local Drupal site, find a page that has cards with images and is exhibiting the above error after updating to Bolt 5.8.0.
Manually copy the change in this PR to the docroot/bolt/twig/packages/components/bolt-card-replacement/src/card-replacement-media/_card-replacement-media.twig. Clear caches, reload the page, and confirm errors are gone and card images display as expected.

@github-actions github-actions bot added the version: patch Use only on PRs to the release branch. Increments the patch version when merged. label Dec 6, 2022
@remydenton remydenton changed the title Update card media deprecation to both src and check attributes.src Update card media deprecation to check both src and attributes.src Dec 6, 2022
@remydenton remydenton merged commit 9dd31f9 into release/5.x Dec 7, 2022
@remydenton remydenton deleted the hotfix/card-images branch December 7, 2022 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
version: patch Use only on PRs to the release branch. Increments the patch version when merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants