Problem/Motivation

I get an error when trying to visit the style_selector.module_config_form route:

TypeError: Drupal\style_selector\Form\ModuleConfigForm::__construct(): Argument #3 ($library_discovery) must be of type Drupal\Core\Asset\LibraryDiscovery, Drupal\Core\Asset\LibraryDiscoveryCollector given

Steps to reproduce

Visit the config form of the module: /admin/config/user-interface/style-selector (style_selector.module_config_form).

Proposed resolution

Drupal\Core\Asset\LibraryDiscovery is deprecated since D11.1: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Asset%21L..., we should use https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Asset%21L... instead.

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

rgeerolf created an issue. See original summary.

rgeerolf’s picture

Assigned: rgeerolf » Unassigned
Status: Active » Needs review
vinodhini.e’s picture

Hi, Encountered the same issue on Drupal 11.2.5.

Steps checked:
- Visited the configuration form: /admin/config/user-interface/style-selector
- Observed the reported issue on initial load

Applied MR #7 and re-checked the configuration form.

The issue is no longer reproducible and the form is working correctly without any errors.

Thanks.

justcaldwell’s picture

Linking the CR: #3462970: LibraryDiscovery class is deprecated

Looks to be backward compatible, but I want to manually test in D10. I'll try to do that in the next few days.