From 7970c17470285c2279d8b4dc89035fa078b106b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Kalij=C3=A4rvi?= Date: Thu, 20 Jun 2024 12:16:00 +0300 Subject: [PATCH] UHF-9950: Do not show the preview button for new node translations. --- hdbt_admin.theme | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hdbt_admin.theme b/hdbt_admin.theme index 91a22a42..fd4ad5d6 100644 --- a/hdbt_admin.theme +++ b/hdbt_admin.theme @@ -128,8 +128,8 @@ function hdbt_admin_form_node_form_alter(&$form, FormStateInterface $form_state) /** @var \Drupal\node\NodeInterface $node */ $node = $formObject->getEntity(); - // Disable "Preview" button on new nodes. - if ($node->isNew()) { + // Disable "Preview" button on new nodes and new translations. + if ($node->isNew() || $node->isNewTranslation()) { $form['gin_actions']['actions']['preview']['#access'] = FALSE; }