Commit cad17767 authored by Ben Mullins's avatar Ben Mullins
Browse files

Issue #3342891 by lauriii, smustgrave, andy-blum, catch: 'node' variable in...

Issue #3342891 by lauriii, smustgrave, andy-blum, catch: 'node' variable in page.html.twig is not available on preview node page
parent 533b9483
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1374,7 +1374,7 @@ function template_preprocess_page(&$variables) {
    $variables['db_is_active'] = FALSE;
  }

  if ($node = \Drupal::routeMatch()->getParameter('node')) {
  if (($node = \Drupal::routeMatch()->getParameter('node')) || ($node = \Drupal::routeMatch()->getParameter('node_preview'))) {
    $variables['node'] = $node;
  }
}
+6 −0
Original line number Diff line number Diff line
@@ -128,6 +128,12 @@ public function testEditNodesByAdmin() {
    $node = reset($nodes);
    $this->drupalGet($node->toUrl('edit-form'));
    $webassert->statusCodeEquals('200');

    $this->submitForm([], 'Preview');
    $webassert->statusCodeEquals('200');
    $this->assertSession()->elementsCount('css', 'h1', 1);
    $this->clickLink('Back to content editing');

    $this->submitForm([], "Save");
    $webassert->pageTextContains('Recipe Deep mediterranean quiche has been updated.');
  }