Skip to content

Commit

Permalink
Merge pull request #280 from City-of-Helsinki/UHF-9738-news-article
Browse files Browse the repository at this point in the history
UHF-9738: Hide content_translation_status published for news articles content type
  • Loading branch information
khalima authored Apr 11, 2024
2 parents 760c8d4 + dcf9319 commit 3d0cd41
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 3d0cd41

Please sign in to comment.