- Issue created by @pablomoto1000
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
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.
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;
}
Explore the best approach for this.
Allow user to save translation.
Needs review
1.1
Code