- Issue created by @super_romeo
Now a translation functionality is added only on forms with add and edit operations.
/**
* Implements hook_form_alter().
*/
function content_translation_form_alter(array &$form, FormStateInterface $form_state) {
...
// Let the content translation handler alter the content entity form. This can
// be the 'add' or 'edit' form. It also tries a 'default' form in case neither
// of the aforementioned forms are defined.
if ($entity instanceof ContentEntityInterface && $entity->isTranslatable() && count($entity->getTranslationLanguages()) > 1 && in_array($op, ['edit', 'add', 'default'], TRUE)) {
// Add translation functionality on the form.
}
}
I added form mode "Donation types".
But this form has operation = donation_types
and no translation functionality has been added.
To add functionality to all form modes.
Active
11.0 🔥