Field breaks when translated

Created on 17 November 2023, about 1 year ago
Updated 23 November 2023, about 1 year ago

Problem/Motivation

When translating Video Embed type of field, the field value is changed to video ID, as opposed to URL.

Field value before saving: https://vimeo.com/869535988

Field value after saving: 869535988

Steps to reproduce

  1. Make the site multilingual, two languages enabled.
  2. Enable Core media module.
  3. Create Video media type with Video Embed field.
  4. Tick the checkbox: [X] Users may translate this field
  5. Tick the checkbox: Allowed Providers: [X] Vimeo
  6. Add a new media item in Content > Media > Add media > Video
  7. Translate it. Don't change the URL. Observe, that the value is properly saved. (In DB, and by reopening edit form).
  8. Edit the translation and change the URL. Observe, that the value is not properly saved. (In DB, and by reopening edit form). It has now only the ID of a video extracted from the URL.

Proposed resolution

When saving a translation, the URL must be saved intact.

Not sure if this qualifies as a fix, but at least the field saves now properly.

In the module replace this:

case 'id': return $url;

It is called from here.

🐛 Bug report
Status

Active

Version

2.5

Component

Video Embed Field (base module)

Created by

🇪🇪Estonia ragnarkurm

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

Comments & Activities

Production build 0.71.5 2024