Issue #3427398 by aaron.ferris, alexpott, sdhruvi5142, rkoller, smustgrave, DanielVeza: Cancel button on the discard changes in the layout builder confirmation step should take you back to the layout builder
(cherry picked from commit 8c50a65a7d
)
merge-requests/7413/head
parent
ee650b2e7f
commit
828a3c56df
|
@ -79,7 +79,7 @@ class DiscardLayoutChangesForm extends ConfirmFormBase {
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
public function getCancelUrl() {
|
||||
return $this->sectionStorage->getRedirectUrl();
|
||||
return $this->sectionStorage->getLayoutBuilderUrl();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -100,7 +100,7 @@ class DiscardLayoutChangesForm extends ConfirmFormBase {
|
|||
|
||||
$this->messenger->addMessage($this->t('The changes to the layout have been discarded.'));
|
||||
|
||||
$form_state->setRedirectUrl($this->getCancelUrl());
|
||||
$form_state->setRedirectUrl($this->sectionStorage->getRedirectUrl());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -94,10 +94,17 @@ class LayoutBuilderUiTest extends WebDriverTestBase {
|
|||
$assert_session = $this->assertSession();
|
||||
$page = $this->getSession()->getPage();
|
||||
|
||||
// Make and then discard changes.
|
||||
$this->assertModifiedLayout(static::FIELD_UI_PREFIX . '/display/default/layout');
|
||||
// Discard then cancel.
|
||||
$page->pressButton('Discard changes');
|
||||
$page->clickLink('Cancel');
|
||||
$assert_session->addressEquals(static::FIELD_UI_PREFIX . '/display/default/layout');
|
||||
$assert_session->pageTextContainsOnce('You have unsaved changes.');
|
||||
|
||||
// Discard then confirm.
|
||||
$page->pressButton('Discard changes');
|
||||
$page->pressButton('Confirm');
|
||||
$assert_session->addressEquals(static::FIELD_UI_PREFIX . '/display/default');
|
||||
$assert_session->pageTextNotContains('You have unsaved changes.');
|
||||
|
||||
// Make and then save changes.
|
||||
|
|
Loading…
Reference in New Issue