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 328
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;
  }
}
doc_Drupal
2016-10-29 08:51:27
Comments
Leave a Comment

Please login to continue.