Skip to content
Snippets Groups Projects
Commit 9c19aaee authored by Eric Bremner's avatar Eric Bremner
Browse files

Merge branch...

Merge branch 'feature/ISTWCMS-6315-l26yan-Remove-required-indicator-on-media-and-media-settings' into '1.1.x'

ISTWCMS-6315 Set 'required' indicator on 'hero image' field on blog, event and...

See merge request !338
parents 11e93730 bcf68b9b
No related branches found
No related tags found
1 merge request!338ISTWCMS-6315 Set 'required' indicator on 'hero image' field on blog, event and...
......@@ -999,6 +999,22 @@ function uw_cfg_common_form_alter(array &$form, FormStateInterface $form_state,
unset($form['settings']['hide_branding']);
}
// Only blog, event and news item has 'Image' option.
$hero_image_form_ids = [
'node_uw_ct_blog_form',
'node_uw_ct_blog_edit_form',
'node_uw_ct_event_form',
'node_uw_ct_event_edit_form',
'node_uw_ct_news_item_form',
'node_uw_ct_news_item_edit_form',
];
if (in_array($form_id, $hero_image_form_ids)) {
// Set required when hero image field shows.
if (isset($form['field_uw_hero_image']['widget'])) {
$form['field_uw_hero_image']['widget']['#required'] = TRUE;
}
}
// Prevent redirects to pilots or staging URLs.
if ($form_id == 'redirect_redirect_form' || $form_id == 'redirect_redirect_edit_form') {
$form['#validate'][] = '_uw_cfg_common_redirect_destination_validation';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment