Commit 58268180 authored by alexpott's avatar alexpott

Issue #2775057 by tedbow, tim.plunkett: Make MenuForm extensible

parent d2c2e437
......@@ -173,12 +173,7 @@ public function menuNameExists($value) {
*/
public function save(array $form, FormStateInterface $form_state) {
$menu = $this->entity;
if (!$menu->isNew() || $menu->isLocked()) {
$this->submitOverviewForm($form, $form_state);
}
$status = $menu->save();
$edit_link = $this->entity->link($this->t('Edit'));
if ($status == SAVED_UPDATED) {
drupal_set_message($this->t('Menu %label has been updated.', array('%label' => $menu->label())));
......@@ -192,6 +187,17 @@ public function save(array $form, FormStateInterface $form_state) {
$form_state->setRedirectUrl($this->entity->urlInfo('edit-form'));
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
parent::submitForm($form, $form_state);
if (!$this->entity->isNew() || $this->entity->isLocked()) {
$this->submitOverviewForm($form, $form_state);
}
}
/**
* Form constructor to edit an entire menu tree at once.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment