Drupal\background_image\Controller\BackgroundImageCssController::__construct(): Argument #7 ($cache) must be of type Drupal\Core\Cache\Cache, Drupal\Core\Cache\CacheFactory given

Created on 29 June 2023, over 1 year ago
Updated 7 November 2023, about 1 year ago

Problem/Motivation

The background image isn't displaying. When inspecting the page it seems the CSS isn't being loaded. I've attached a screenshot of what I'm seeing in the browsers console. I can also see the markup on the page, as per the other screenshot.

If I try opening the CSS file in a new tab I get the website error page. There isn't a CSS file in the directory.

In the Drupal logs I can see this

TypeError: Drupal\background_image\Controller\BackgroundImageCssController::__construct(): Argument #7 ($cache) must be of type Drupal\Core\Cache\Cache, Drupal\Core\Cache\CacheFactory given, called in \web\modules\contrib\background_image\src\Controller\BackgroundImageCssController.php on line 155 in Drupal\background_image\Controller\BackgroundImageCssController->__construct() (line 125 of \web\modules\contrib\background_image\src\Controller\BackgroundImageCssController.php).

Other than that, I'm using Drupal 10. I've also followed the tutorial and re-read it god knows how many times.

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇬🇧United Kingdom gMaximus

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

Comments & Activities

Production build 0.71.5 2024