Mercurial > hg > cmmr2012-drupal-site
comparison core/modules/views_ui/src/ViewAddForm.php @ 4:a9cd425dd02b
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:11:55 +0000 |
parents | c75dbcec494b |
children | 12f9dff5fda9 |
comparison
equal
deleted
inserted
replaced
3:307d7a7fd348 | 4:a9cd425dd02b |
---|---|
182 $wizard = $form_state->get('wizard_instance'); | 182 $wizard = $form_state->get('wizard_instance'); |
183 $this->entity = $wizard->createView($form, $form_state); | 183 $this->entity = $wizard->createView($form, $form_state); |
184 } | 184 } |
185 // @todo Figure out whether it really makes sense to throw and catch exceptions on the wizard. | 185 // @todo Figure out whether it really makes sense to throw and catch exceptions on the wizard. |
186 catch (WizardException $e) { | 186 catch (WizardException $e) { |
187 drupal_set_message($e->getMessage(), 'error'); | 187 $this->messenger()->addError($e->getMessage()); |
188 $form_state->setRedirect('entity.view.collection'); | 188 $form_state->setRedirect('entity.view.collection'); |
189 return; | 189 return; |
190 } | 190 } |
191 $this->entity->save(); | 191 $this->entity->save(); |
192 drupal_set_message($this->t('The view %name has been saved.', ['%name' => $form_state->getValue('label')])); | 192 $this->messenger()->addStatus($this->t('The view %name has been saved.', ['%name' => $form_state->getValue('label')])); |
193 $form_state->setRedirectUrl($this->entity->urlInfo('edit-form')); | 193 $form_state->setRedirectUrl($this->entity->urlInfo('edit-form')); |
194 } | 194 } |
195 | 195 |
196 /** | 196 /** |
197 * Form submission handler for the 'cancel' action. | 197 * Form submission handler for the 'cancel' action. |