fix: #3634660 Count a default provider whose module is not installed as not set up

Closes https://www.drupal.org/project/ai_media/issues/3634660

A default provider in ai.settings whose module is not installed (uninstalled later, or config imported before the module) made isConfigured() TRUE: editors were offered Generate with AI and got "This could not be made. Try again.", and the paid-request line showed the raw plugin id. defaultFor() now returns NULL when the provider plugin has no definition, so the generator reads as not set up: no switch for editors, the "not set up" message for administrators.

Kernel test: ErrorMessagesTest::testMissingProviderModuleIsNotSetUp.

Before: the editor is offered Generate with AI, presses Generate and gets "This could not be made. Try again."; the paid-request line names the raw plugin id.

Before: Generate offered, then This could not be made

After, as a content editor: no switch, the plain upload form.

After, editor: upload only

After, as an administrator: the not set up message names the operation and links to the AI settings.

After, administrator: Image generation is not set up

AI-Generated: Yes

Checkpoints:

  • File an issue
  • Addition/Change/Update/Fix
  • Testing to ensure no regression
  • Automated unit testing coverage
  • Automated functional testing coverage
  • UX/UI designer responsibilities
  • Readability
  • Accessibility
  • Performance
  • Security
  • Developer Documentation
  • User Guide Documentation
  • Reviewed by human
  • Code review by maintainers
  • Full testing and approval
  • Credit contributors
  • Review with the product owner
  • Release notes snippet
  • Release

🤖 Generated with Claude Code

Edited by Rajab Natshah

Merge request reports

Loading
Loading