Same name in other branches
- 4.x src/Form/QuickTabsInstanceEditForm.php \Drupal\quicktabs\Form\QuickTabsInstanceEditForm::save()
File
-
src/
Form/ QuickTabsInstanceEditForm.php, line 289
Class
- QuickTabsInstanceEditForm
- Class QuickTabsInstanceEditForm.
Namespace
Drupal\quicktabs\FormCode
public function save(array $form, FormStateInterface $form_state) {
// We need the configuration_data array to be indexed according to weight
// So change the indexes here.
$ordered_configuration_data = [];
foreach ($this->entity
->getConfigurationData() as $item) {
$ordered_configuration_data[] = $item;
}
$this->entity
->setConfigurationData($ordered_configuration_data);
$status = $this->entity
->save();
if ($status == SAVED_NEW) {
$form_state->setRedirect('quicktabs.admin');
}
$this->messenger
->addStatus($this->t('Your changes have been saved.'));
drupal_flush_all_caches();
}