/** * {@inheritdoc} */ public function save(array $form, FormStateInterface $form_state) { $this->entity->save(); drupal_set_message($this->t('Saved %label configuration.', array('%label' => $this->entity->getLabel()))); $request = $this->getRequest(); if (($destinations = $request->query->get('destinations')) && ($next_destination = FieldUI::getNextDestination($destinations))) { $request->query->remove('destinations'); $form_state->setRedirectUrl($next_destination); } else { $form_state->setRedirectUrl(FieldUI::getOverviewRouteInfo($this->entity->getTargetEntityTypeId(), $this->entity->bundle)); } }