A "Book name" plugin shows in config when book module not installed; WSOD if you check it

Created on 2 March 2024, 9 months ago
Updated 3 March 2024, 9 months ago

Problem/Motivation

A "Book name" plugin shows as a plugin that you can enable on the module's configuration page, even when the book module is not installed. If you enable it, then the sitemap displays a WSOD.

Steps to reproduce

  1. Install a fresh Drupal 10 test site using the standard install profile (my test site was on 10.1.x).
  2. Download and install the 8.x-2.x-dev version of the module: composer require "drupal/sitemap:2.x-dev@dev"
  3. Go to /admin/modules. Note that the Core -> Book module is unchecked (uninstalled). Leave it that way.
  4. Go to /admin/modules. Check the checkbox next to Other -> Sitemap to install it, then click "Install".
  5. Go to /admin/config/search/sitemap. Note under Enabled plugins, there is a "Book name" checkbox. Check it, and click "Save configuration". You see the message "The configuration options have been saved"
  6. Go to /sitemap. You see a WSOD, or the message "The website encountered an unexpected error. Please try again later." In the dblog, you see a php message: Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "book.manager". in Drupal\Component\DependencyInjection\Container->get() (line 157 of /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php).
  7. Go to /admin/modules. Check the checkbox next to Core -> Book to install it, then click "Install".
  8. Go to /sitemap. You see the sitemap again, but not a "Book name" section.
  9. Go to /admin/config/search/sitemap. Note under Enabled plugins, the "Book name" plugin has disappeared.

Proposed resolution

Don't display plugins if the module they depend on is not installed.

Remaining tasks

  1. Write a patch
  2. Review and feedback
  3. RTBC and feedback
  4. Commit

User interface changes

Plugins will no longer display if the module that they depend on is not installed.

API changes

To be determined.

Data model changes

To be determined.

🐛 Bug report
Status

Closed: duplicate

Version

2.0

Component

Code

Created by

🇨🇦Canada mparker17 UTC-4

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

Comments & Activities

Production build 0.71.5 2024