Skip to content

Installation

Requirements

  • Drupal 10.4 or 11
  • league/commonmark ^2.8, installed by Composer automatically

The module depends only on core's field module. Some features use other modules, see Integrations.

Installing

composer require drupal/ai_disclosure
drush en ai_disclosure

Installing the module creates the nine grades, the module settings, and the suggestion table. The compliance report view installs with the node and views core modules. Enable them before or after this module, the view follows either way. Its CSV export is a separate submodule, ai_disclosure_csv_export, which needs rest and serialization: enable it too if the export command should show.

Five more submodules are optional, and none is enabled by installing the module:

After installing, start at /admin/config/content/ai-disclosure: set the site policy, create profiles, and add the field to the bundles that need it.

Updating

composer update drupal/ai_disclosure
drush updb
drush cr

drush updb runs the update functions a release ships. The release history lists what each one changes. drush cr rebuilds the caches so the new code and definitions are used.

Admin wording changed: translations of the changed strings must be redone. Drupal keys a translation by its source text, so a reworded label or description loses its translation until it is translated again. Strings shown to readers did not change.

Uninstalling

Uninstalling deletes every disclosure

The stored disclosures go with the field, and reinstalling does not bring them back. Download the CSV export first if you need a record. To stop showing the disclosure and keep the data, hide the field in Manage display instead. Your uploaded files are never changed, so pages show the originals once the module is gone.

The module does not uninstall while the ai_disclosure field is on a bundle. The guard is core's: uninstalling would drop every stored disclosure.

The Fields tab has a Remove from all bundles action that takes the field off every bundle of every entity type in one confirmed step. The confirmation names each bundle, and the stored values are deleted with it, none suppressions included.

Removing the field is not the whole job. Core counts a field storage as in use until its data has been purged, so the uninstall page keeps blocking, now with "Fields pending deletion". The action purges what a single pass can take. On a site with much content the rest is purged on the next cron run, and the uninstall page names whichever of the two states you are in.

The ai_disclosure_audit submodule cannot be uninstalled while it holds records. Run drush ai-disclosure-audit:purge to clear them. See Removing the records.

The uninstall also takes away the two views the module ships, the compliance report and the suggestions listing. Export either one first if you want to keep how you have set it up.