You are here

function facebook_comments_form_field_storage_config_edit_form_alter in Facebook Comments Social Plugin 8

Implements hook_form_FORM_ID_alter() for 'field_storage_config_edit_form'.

File

./facebook_comments.module, line 23
Enables users to use Facebook comments on content.

Code

function facebook_comments_form_field_storage_config_edit_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state) {
  if ($form_state
    ->getFormObject()
    ->getEntity()
    ->getType() == 'facebook_comments') {

    // 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;
    $form['facebook_comments'] = array(
      '#markup' => t('There are no field settings. All configuration happens at the "Manage display" tab.'),
    );
  }
}