function comment_form_field_storage_config_edit_form_alter

comment_form_field_storage_config_edit_form_alter(&$form, FormStateInterface $form_state)

Implements hook_form_FORM_ID_alter() for 'field_storage_config_edit_form'.

File

core/modules/comment/comment.module, line 327
Enables users to comment on published content.

Code

function comment_form_field_storage_config_edit_form_alter(&$form, FormStateInterface $form_state) {
  if ($form_state->getFormObject()->getEntity()->getType() == 'comment') {
    // We only support posting one comment at the time so it doesn't make sense
    // to let the site builder choose anything else.
    $form['cardinality_container']['cardinality']['#default_value'] = 1;
    $form['cardinality_container']['#access'] = FALSE;
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!comment!comment.module/function/comment_form_field_storage_config_edit_form_alter/8.1.x