Loading
task: #3633542 Use Drupal AI's default providers, and remove AI Media's Providers tab
Issue: #3633542
AI Media now always uses the Drupal AI default provider and model for each operation (text_to_image, image_to_video, chat, chat_with_image_vision). It no longer keeps a provider choice of its own. Mostly deletions.
What changed
- Removed the Providers tab from the settings form, with its validation, submit handling and the select label helper. The Usage links (AI Logging, AI Observability) move to the Advanced tab.
- Removed
providersfromconfig/installand the schema.AiMediaGeneratorBase::defaultFor()andAiMediaMetadata::providerFor()now read onlygetDefaultProviderForOperationType(). - "Not set up" now tells administrators to choose a default provider and links to the AI settings (
ai.settings_form). - The editor model choice (
editor_options.*.models) stays as it was. It already uses Drupal AI's model lists, and now preselects the AI default. - No update hook. A stale
providersvalue is ignored, and saving the AI Media settings removes it. The docs say so. - Tests, the e2e fixtures recipe and the docs (providers, settings, AI integration, troubleshooting) set the Echo test provider as the AI default.
MR !25 (merged) (#3633456, request tags) does not depend on this change. Either can merge first.
Tested
- Kernel: the existing tests now set
ai.settingsdefaults. NewErrorMessagesTest::testNotSetUpLinksToTheAiSettings. 82 tests pass locally on Drupal 11.4. - phpcs (Drupal, DrupalPractice) and phpstan clean.
- Dev site (Varbase 11): the settings form has no Providers tab. One image generated with the Drupal AI default (OpenAI gpt-image-1-mini), while the stale
providersconfig still pointed at another provider.
AI-Generated: Yes. Drafted and tested with Claude Code.
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
- Documentation
- Reviewed by a human
- Code review by maintainers
- Full testing and approval
- Credit contributors
- Review with the product owner
- Release notes snippet
- Release
Edited by Rajab Natshah