template_preprocess_node() does not add cacheability metadata

Created on 7 July 2015, over 9 years ago
Updated 23 March 2023, over 1 year ago

Problem/Motivation

  // The 'page' variable is set to TRUE in two occasions:
  //   - The view mode is 'full' and we are on the 'node.view' route.
  //   - The node is in preview and view mode is either 'full' or 'default'.
  $variables ['page'] = ($variables ['view_mode'] == 'full' && (node_is_page($node)) || (isset($node->in_preview) && in_array($node->preview_view_mode, array('full', 'default'))));

node_is_page() looks like this:
https://api.drupal.org/api/drupal/core%21modules%21node%21node.module/fu...

So it should add the route context.

And also $node->in_preview - this probably needs a cache context too.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs work

Version

10.1

Component
Node system 

Last updated 4 days ago

No maintainer
Created by

🇬🇧United Kingdom catch

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024