Skip to content
Snippets Groups Projects
Commit bdc9f190 authored by Eric Bremner's avatar Eric Bremner Committed by Kevin Paxman
Browse files

ISTWCMS-5846: ensuring that opportunities works with blank summaries

parent 30d2c4ce
No related branches found
No related tags found
2 merge requests!295ISTWCMS-5846: adding code and config for blank summaries,!274Draft: ISTWCMS-5551: fixing office hours display
......@@ -941,10 +941,17 @@ function uw_cfg_common_form_alter(array &$form, FormStateInterface $form_state,
// to be used in the field name.
$node_type = str_replace('_item', '', $node_type);
// Now since all the fields names are the same,
// field_uw_<node_type>_summary, we can get
// the proper field name.
$field_name = 'field_uw_' . $node_type . '_summary';
// If the node type is an opportunity, we have to give
// the specific field name.
if ($node_type == 'opportunity') {
$field_name = 'field_uw_opportunity_position';
}
// Now since all the rest of the field names
// are the same, field_uw_<node_type>_summary,
// we can get the proper field name.
else {
$field_name = 'field_uw_' . $node_type . '_summary';
}
// Set the states of the summary, required and visible.
$form[$field_name]['widget'][0]['#states'] = [
......
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