ai_disclosure_csv_export cannot be installed or uninstalled without Views

Problem/Motivation

ai_disclosure_csv_export cannot be installed on a site without Views, and once it fails ai_disclosure cannot be uninstalled either. Install, uninstall and ai_disclosure_csv_export_update_10001() call getStorage('view'), which throws when the view entity type does not exist. The .info.yml depends on drupal:rest and drupal:serialization, and rest does not bring Views.

Found on Drupal 10.4.10 and 10.6.18 with PHP 8.1 on a minimal profile. The kernel tests enable Views, so they never hit it.

Steps to reproduce

  1. Install Drupal with the minimal profile.
  2. drush en ai_disclosure ai_disclosure_csv_export
  3. "The "view" entity type does not exist." and exit code 1.

Proposed resolution

Add drupal:views to the dependencies of ai_disclosure_csv_export. The submodule adds a display to the report view, so it has nothing to do without Views. Sites that have it installed already have Views, since the install could not succeed otherwise.

Remaining tasks

  • Dependency and the comment in _ai_disclosure_csv_export_attach_export_display()
  • Kernel test installing the submodule without Views enabled first

AI Compliance

🤖 Generated with the help of an LLM, reviewed and approved by me before posting.

Edited by Giorgio Alfredo Pagano