Getting encountered error, after enable the theme

Created on 8 November 2023, about 1 year ago
Updated 6 January 2024, 10 months ago

Problem/Motivation

Got the below error while enabling the dempo theme.
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "file_url_generator". Did you mean this: "url_generator"? in Drupal\Component\DependencyInjection\Container->get()
I have attached a screenshot for better reference.

Steps to reproduce

Drupal version: 9
Install the dempo drupal theme with the above versions. Install and set default the dempo theme You will get the website encountered error.

Proposed resolution

replace the Drupal Drupal::service('file_url_generator'). This service used after Drupal 9.3.x versions and not in the 9.2.x version.
\Drupal::service('file_url_generator')->generateString(theme_get_setting('logo.url'));

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India Nitin shrivastava

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

Comments & Activities

Production build 0.71.5 2024