Skip to content

Commit

Permalink
UHF-9738: Hide "menu link translation" published on news articles
Browse files Browse the repository at this point in the history
  • Loading branch information
hyrsky committed Apr 8, 2024
1 parent 760c8d4 commit dcf9319
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion hdbt_admin.theme
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit dcf9319

Please sign in to comment.