Wrong rows array when template is copied into theme

Created on 2 February 2024, 10 months ago
Updated 8 February 2024, 10 months ago
  • Fresh Drupal install 10.2.2
  • PHP 8.1.27

I create a very simple view named "Slider" with view mode "Bootstrap Carousel" as a block (or page, same behavior).
I display the block in "Content" region.

I check and everything works as expected.

Now I cd to modules/contrib/views_bootstrap/templates and copy the views-bootstrap-carousel.html.twig
I paste the file to my theme folder (I use Radix 8.x-4.13 for Bootstrap 4) templates/views folder and rename it accordingly (views-view--slider.html.twig) then clear the caches.

The template from my theme is in use but the view appears empty.

If I do a {{ dump(rows) }} in the module template file (not in my override in my theme), this is what I get:

Now if I do the same {{ dump(rows) }} in my theme copied template, this is what I get:

This is the HTML produced by the template file from my theme:

<div id="slider" class="carousel " data-interval="" data-pause="false">
  <div class="carousel-inner">
    <div class="carousel-item active">

    </div>
  </div>
</div>

Obviously, the template doesn't print the rows correctly since the rows array is totally different.

The same seems to happen with the Cards view mode. Haven't tried others but I have Grid view templates in a project that uses the same module version and same Drupal version that work without any issue.

🐛 Bug report
Status

Closed: works as designed

Version

4.4

Component

Carousel

Created by

🇨🇭Switzerland mrupsidown

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

Comments & Activities

Production build 0.71.5 2024