I have two views:

  • The first with a view ID 'case_studies' and a display ID of 'home_promo'.
  • The second with a view ID 'work' and a display ID of 'work_list'.

They both display Case Study nodes, but in two different fashions. Currently, the theme hook suggestions are always wrong on one of the views and this changes every time I a perform a `drush cr`

Here is what I'm currently seeing for the 'home_promo' display of 'case_studies':

Case Studies theme hook suggestions

case_study_home_promo

You can see the theme hook for the view is correct, but once the nodes are rendered in the view the theme hook suggestions are incorrect (should be 'node--view--case-studies--home-promo.html.twig) and are for the
'work-list' display id of my 'work' view. How is this possible?

The hook suggestions on the 'work' view are fine:

Work List theme hook suggestions

work_work_list

Now...Here comes the rub. If I perform a `drush cr`. The 'case_studies' hook suggestions are now correct, and the 'work' view is incorrect:

Case Studies theme hook suggestions

Only local images are allowed.

Work List theme hook suggestions

work_wrong

Now using the incorrect: node--view--case-studies--home-promo.html.twig

The suggestions just keep flip flopping like this on every cache clear. This seems to be something fundamentally broken in how the hook suggestions are produced for nodes in a view?

Issue fork drupal-2790357

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

squidgle created an issue. See original summary.

frogdog_tech’s picture

Title: Theme Hook Suggestions Inccorect, Change on Cache Rebuild » Theme Hook Suggestions Incorect and Changes on Cache Rebuild
frogdog_tech’s picture

frogdog_tech’s picture

Issue summary: View changes
frogdog_tech’s picture

Title: Theme Hook Suggestions Incorect and Changes on Cache Rebuild » Theme Hook Suggestions Incorrect and Changes on Cache Rebuild
joelpittet’s picture

Could you add the minimum steps to reproduce this to the issue summary?

frogdog_tech’s picture

Status: Active » Closed (outdated)

seems to have fixed itself after core update.

joelpittet’s picture

Sweet, thanks @squidgle

auseidon986’s picture

Version: 8.2.0-beta2 » 11.0.x-dev

This issue is back again.

gábor hojtsy’s picture

Version: 11.0.x-dev » 11.x-dev

Moving to 11.x as per https://www.drupal.org/about/core/blog/new-drupal-core-branching-scheme-..., please reopen if not outdated.

drunir’s picture

i have the same issue in drupal 10.1.2

drunir’s picture

Status: Closed (outdated) » Active

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.