From dcf9319992613e2cc2d568b9f70656b68f9a88a3 Mon Sep 17 00:00:00 2001 From: Santeri Hurnanen Date: Mon, 8 Apr 2024 07:07:30 +0300 Subject: [PATCH] UHF-9738: Hide "menu link translation" published on news articles --- hdbt_admin.theme | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hdbt_admin.theme b/hdbt_admin.theme index 03714ea1..499300ac 100644 --- a/hdbt_admin.theme +++ b/hdbt_admin.theme @@ -133,10 +133,15 @@ function hdbt_admin_form_node_form_alter(&$form, FormStateInterface $form_state) $form['gin_actions']['actions']['preview']['#access'] = FALSE; } + $news_content_types = [ + 'news_item', + 'news_article', + ]; + // Don't show "menu link translation" published checkbox on news items, as // news items cannot be added to any menu. if ( - $node->getType() === 'news_item' && + in_array($node->getType(), $news_content_types) && isset($form['menu']['content_translation_status']) ) { $form['menu']['content_translation_status']['#access'] = FALSE;