Browse Source

made group name a required field

4.0.x-roblib
ppound 2 years ago
parent
commit
e17c753c36
  1. 1
      reservation.inc

1
reservation.inc

@ -116,6 +116,7 @@ function reserve_form_reserve_reservation_form_alter(array &$form, FormStateInte
$bundleName = $bundle_info[$entity->getEntityTypeId()][$entity->bundle()]['label']; $bundleName = $bundle_info[$entity->getEntityTypeId()][$entity->bundle()]['label'];
// set default Group Name as name of current user // set default Group Name as name of current user
$form['name']['widget'][0]['value']['#required'] = TRUE;
$form['name']['widget'][0]['value']['#default_value'] = $form['name']['widget'][0]['value']['#default_value'] ? $form['name']['widget'][0]['value']['#default_value'] = $form['name']['widget'][0]['value']['#default_value'] ?
$form['name']['widget'][0]['value']['#default_value'] : $form['name']['widget'][0]['value']['#default_value'] :
\Drupal::currentUser()->getDisplayName(); \Drupal::currentUser()->getDisplayName();

Loading…
Cancel
Save