Closed (fixed)
Project:
radix
Version:
6.0.1
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
26 Feb 2025 at 20:29 UTC
Updated:
1 Oct 2026 at 13:40 UTC
Jump to comment: Most recent
When you add a views template override, duplicates of the same override appear and show as selected in twig debug, but the view no longer displays any output.
<!-- FILE NAME SUGGESTIONS:
▪️ views-view--news--all.html.twig
▪️ views-view--news.html.twig
✅ views-view.html.twig
-->
Create the file views-views--news--all.html.twig, using the same content as views-view.html.twig, and now you see:
<!-- FILE NAME SUGGESTIONS:
✅ views-view--news--all.html.twig
▪️ views-view--news.html.twig
✅ views-view--news--all.html.twig
▪️ views-view--news.html.twig
✅ views-view--news--all.html.twig
▪️ views-view.html.twig
-->In my case I'm using Drupal CMS with radix and my own subtheme.
The same problem exists if I copy the views-view--news--all.html.twig file into my Radix Starter Kit template directory.
I'm using the pre-created "News" view with three displays "All News", "Latest News", and "Related News".
This code probably creates the theme suggestions - from the top of the radix views.theme file:
/**
* @file
* Theme and preprocess functions for views.
*/
/**
* Implements hook_theme_suggestions_HOOK_alter().
*/
function radix_theme_suggestions_views_view_alter(array &$suggestions, array $variables) {
// Add a suggestion based on the view name and the current display.
$view = $variables['view'];
$name = $view->id();
$display = $view->current_display;
$suggestions[] = 'views_view__' . $name;
$suggestions[] = 'views_view__' . $name . '__' . $display;
}
Comments
Comment #2
tstermitzComment #3
tstermitzComment #4
doxigo commentedIt's been a while since I last looked into this and I don't recall the reason for it Tom, I wonder if it's a core issue but we'll investigate, thanks
Comment #6
doxigo commentedThis one took a while Tom, you were right about the cause. Core's
ViewExecutable::buildThemeFunctions()already builds the whole list, includingviews_view__NAMEandviews_view__NAME__DISPLAY, soViewHookswas appending entries that were already there. Same for the unformatted one.The no-output part does not reproduce on 6.0.x. I added a
views-view--content--page-1.html.twigoverride, and it resolves and renders rows normally, so that half looks fixed since 6.0.1. Only the doubled debug list was left.While in there the exposed form alter was emitting nonsense. It splits the form
#idon dashes and reads index 2 as the view id, but the id isviews-exposed-form-content-page-1, so index 2 is the wordform. Every exposed filter was gettingviews_exposed_form__form. Core covers this one too.Removed all three