Commit 34aa8307 authored by xjm's avatar xjm

Issue #2936501 by tim.plunkett, andrewmacpherson, EclipseGc, DyanneNova,...

Issue #2936501 by tim.plunkett, andrewmacpherson, EclipseGc, DyanneNova, bnjmnm, benjifisher, webchick, phenaproxima, jrockowitz: Reverting an override redirects the user to an edit form for a new override and therefore still sets the new override as "unsaved changes", which is confusing
parent 1a945e7e
......@@ -111,7 +111,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
$this->layoutTempstoreRepository->delete($this->sectionStorage);
$this->messenger->addMessage($this->t('The layout has been reverted back to defaults.'));
$form_state->setRedirectUrl($this->getCancelUrl());
$form_state->setRedirectUrl($this->sectionStorage->getRedirectUrl());
}
}
......@@ -251,12 +251,13 @@ public function testLayoutBuilderUi() {
$assert_session->linkExists('Revert to defaults');
$this->clickLink('Revert to defaults');
$page->pressButton('Revert');
$assert_session->addressEquals('node/1');
$assert_session->pageTextContains('The layout has been reverted back to defaults.');
$assert_session->elementExists('css', '.field--name-title');
$assert_session->elementNotExists('css', '.field--name-nid');
$assert_session->pageTextContains('The first node body');
$assert_session->pageTextContains('Powered by Drupal');
$assert_session->pageTextContains('Placeholder for the "Extra label" field');
$assert_session->pageTextContains('Extra, Extra read all about it.');
// Assert that overrides can be turned off now that all overrides are gone.
$this->drupalPostForm("$field_ui_prefix/display/default", ['layout[allow_custom]' => FALSE], 'Save');
......
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