Problem/Motivation

The code in MicromodalFieldFormatter::viewElements() won't render a possible translation in case the media reference field is flagged as translatable.

Steps to reproduce

  • Enable content translation and media
  • On the article content type, create a media reference field marking it as translatable
  • Use the media_video_micromodal formatter for the media field
  • Create a media in EN and translate it to DE
  • Create an article in EN referencing the media created above
  • Translate the article into DE NOT manually changing the media reference (because the reference field will load the right translation)
  • View the article

Expected result: The modal opens the translated video media.
Actual result: The modal opens the EN version of the video

Proposed resolution

Load a possible translation in the formatter.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

s_leu created an issue. See original summary.

s_leu’s picture

Issue summary: View changes
s_leu’s picture

Issue summary: View changes

s_leu’s picture

Status: Active » Needs review
heddn’s picture

Status: Needs review » Reviewed & tested by the community

Nice find and fix. LGTM.

scott_earnest’s picture

This has been merged into the dev branch.
I will update the ticket once it has been rolled into a release.

Thank you for your contribution!

scott_earnest’s picture

Assigned: Unassigned » scott_earnest
Status: Reviewed & tested by the community » Fixed

Fixed in the 1.x branch - Once this is rolled into a release I will update this ticket.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

scott_earnest’s picture

Status: Closed (fixed) » Active
scott_earnest’s picture

Version: 1.x-dev » 1.1.3
Status: Active » Fixed

fixed in 1.1.3

thanks @s_leu & @heddn !

scott_earnest’s picture

Status: Fixed » Closed (fixed)