DAM Media not working on translation

Created on 22 April 2025, 2 days ago

Problem/Motivation

I'm receiving 'Media items cannot be added from this form, only through the media library when editing content.' error while trying to translate Acquia DAM Media, also the form gets disabled so I'm unable to save the translation. I found the issue comes from line 397 in version 1.1.1 in acquia_dam/acquia_dam.module

Steps to reproduce

1) Have a Drupal 10 multilanguage site running.
2) Create media pulling from DAM and add extra fields.
3) Get into DAM Media content, select one and click translate to the desired language.
4) Try to save the translation.

Proposed resolution

Remove or tweak function
if (str_ends_with($form_id, '_add_form')) {
// Disable the save button with a warning.
// @todo figure out a better user experience rather then driving users into a dead-end street.
\Drupal::messenger()->addWarning(t('Media items cannot be added from this form, only through the media library when editing content.'));
$form['actions']['submit']['#disabled'] = TRUE;
}

Remaining tasks

Explore the best approach for this.

User interface changes

Allow user to save translation.

API changes

Data model changes

🐛 Bug report
Status

Needs review

Version

1.1

Component

Code

Created by

🇨🇴Colombia pablomoto1000

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

Comments & Activities

Production build 0.71.5 2024