Verified Commit 892c4041 authored by Théodore Biadala's avatar Théodore Biadala
Browse files

Issue #3458608 by nishtha.pradhan, ankitv18, vinmayiswamy, quietone, catch,...

Issue #3458608 by nishtha.pradhan, ankitv18, vinmayiswamy, quietone, catch, smustgrave: Deprecate $variables['view'] for node.html.twig
parent 5e1c30b5
Loading
Loading
Loading
Loading
Loading
+4 −0
Changes for core/modules/views/views.module: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -237,6 +237,10 @@ function views_preprocess_node(&$variables) {
  // \Drupal\views\Plugin\views\row\EntityRow::preRender().
  if (!empty($variables['node']->view) && $variables['node']->view->storage->id()) {
    $variables['view'] = $variables['node']->view;

    // The view variable is deprecated.
    $variables['deprecations']['view'] = "'view' is deprecated in drupal:11.1.0 and is removed in drupal:12.0.0. There is no replacement. See https://www.drupal.org/node/3459903";

    // If a node is being rendered in a view, and the view does not have a path,
    // prevent drupal from accidentally setting the $page variable:
    if (!empty($variables['view']->current_display)