Commit 1faa0113 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

(cherry picked from commit 47258e9e)
parent 9d954ccd
Loading
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -579,8 +579,13 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
      $this->saveDisplayStatuses($statuses);
    }

    // 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.'));
    }
  }

  /**
   * {@inheritdoc}
+1 −0
Original line number Diff line number Diff line
@@ -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');