Media Title missing after selection in asset browser

Created on 5 January 2023, almost 2 years ago
Updated 30 January 2023, almost 2 years ago

Problem/Motivation

After selecting a media item with the asset browser its title cannot be accessed for further usage - e.g. automatic filling of fields via PDs relations functionality.

Steps to reproduce

Create a pattern that automatically sets a field value based on a media items title. Example:

img:
  label: Image
  category: Element
  pagedesigner: 1
  type: component
  fields:
    image_fiel:
      type: image
      label: The image
    image_title:
      type: text
      label: The image title text
    image_alt:
      type: text
      label: The image alt text

  relations:
    image_img:
      image_alt:
        source_key: alt
        override: true
      image_title:
        source_key: title
        override: true

Insert a component in pagedesigner.

The image alt is set according to the alt text of the media items image. However, the title field is not filled out.

Proposed resolution

The updateTarget() function of the asset manager only sets id, source & alt. title could also be set, with:

trait.setValueFromAssetManager({
  id: this.model.get('id'),
  src: this.model.get('src'),
  alt: this.model.get('alt'),
  preview: this.model.get('preview'),
  title: this.model.get('name')
});
🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇨🇭Switzerland danielwirz

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024