Skip to content

Commit

Permalink
Issue #3495014: Fix display of the field and the label of the enrollm…
Browse files Browse the repository at this point in the history
…ent limit in the event
  • Loading branch information
Agamich-FE authored and ribel committed Dec 20, 2024
1 parent 43f0adc commit d23bda4
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ function social_event_max_enroll_form_alter(&$form, FormStateInterface $form_sta
],
];

// Hide all `Enrollment limit` wrapper
// if event enrollment is disabled for event.
if (!$form['field_event_max_enroll']['#access'] && !$form['field_event_max_enroll_num']['#access']) {
$form['field_event_max_enroll_wrapper']['#access'] = FALSE;
}

$form['field_event_max_enroll_wrapper']['field_event_max_enroll'] = $form['field_event_max_enroll'];
$form['field_event_max_enroll_wrapper']['field_event_max_enroll_num'] = $form['field_event_max_enroll_num'];
unset($form['field_event_max_enroll'], $form['field_event_max_enroll_num']);
Expand Down

0 comments on commit d23bda4

Please sign in to comment.