ConditionalFieldEditFormTab.php in Conditional Fields 4.x
File
src/Form/ConditionalFieldEditFormTab.php
View source
<?php
namespace Drupal\conditional_fields\Form;
use Drupal\Core\Form\FormStateInterface;
class ConditionalFieldEditFormTab extends ConditionalFieldEditForm {
protected $redirectPath = 'conditional_fields.tab';
public function getFormId() {
return 'conditional_field_edit_form_tab';
}
public function submitForm(array &$form, FormStateInterface $form_state) {
parent::submitForm($form, $form_state);
$values = $form_state
->cleanValues()
->getValues();
$parameters = [
"{$values['entity_type']}_type" => $values['bundle'],
];
$redirect = $this->redirectPath . "." . $values['entity_type'];
$form_state
->setRedirect($redirect, $parameters);
}
}