Hi guys,

I'm trying to add a vertical tab to an inline entity form using hook_inline_entity_form_entity_form_alter(). Here's my code.

/**
 * Implements hook_inline_entity_form_entity_form_alter().
 */
function my_module_inline_entity_form_entity_form_alter(&$form, &$form_state) {

  $form['tabs'] = array(
    '#type' => 'vertical_tabs',
    '#weight' => 99
  );

  $form['author'] = array(
    '#type' => 'details',
    '#title' => t('Authoring information'),
    '#group' => 'tabs',
    '#weight' => 50
  );

  if (isset($form['uid'])) {
    $form['uid']['#group'] = 'author';
  }

  if (isset($form['created'])) {
    $form['created']['#group'] = 'author';
  }

  drupal_set_message('Here I am.');
}

I know the hook is called because the message is printed, but no vertical tab is added. Also it is difficult to debug because both kint() and dpr() crash the ajax request. I'm on Drupal 8.2.6 with drush rs as http server. Any guess?

Comments

OutlawPlz created an issue. See original summary.

markhalliwell’s picture

This is byproduct/symptom of the related issue.