function comment_form_field_storage_config_edit_form_alter in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/comment/comment.module \comment_form_field_storage_config_edit_form_alter()
Implements hook_form_FORM_ID_alter() for 'field_storage_config_edit_form'.
File
- core/
modules/ comment/ comment.module, line 325 - 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;
}
}