Skip to content
Snippets Groups Projects
Commit 47258e9e authored by catch's avatar catch
Browse files

Issue #2941189 by DanielVeza, longwave, smustgrave, xjm, tim.plunkett:...

Issue #2941189 by DanielVeza, longwave, smustgrave, xjm, tim.plunkett: Confirmation form for disabling per-entity layout overrides shows a success message and should not
parent f1b4d8cc
No related branches found
No related tags found
No related merge requests found
......@@ -579,7 +579,12 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
$this->saveDisplayStatuses($statuses);
}
$this->messenger()->addStatus($this->t('Your settings have been saved.'));
// The saved message may not be needed in some cases. An example of
// this is in LayoutBuilderEntityViewDisplayForm which can redirect
// the user to a confirmation form before the settings are saved.
if (!$form_state->getRedirect()) {
$this->messenger()->addStatus($this->t('Your settings have been saved.'));
}
}
/**
......
......@@ -91,6 +91,7 @@ public function testRenderByContextAwarePluginDelegate() {
// Disabling defaults does not prevent the section storage from running.
$this->drupalGet('admin/structure/types/manage/bundle_with_section_field/display/default');
$this->submitForm(['layout[enabled]' => FALSE], 'Save');
$this->assertSession()->pageTextNotContains('Your settings have been saved');
$page->pressButton('Confirm');
$assert_session->pageTextContains('Layout Builder has been disabled');
$this->drupalGet('node/1');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment