fix: #3634864 List only media types with a usable generator on the Generate media with AI list

Issue: https://www.drupal.org/project/ai_media/issues/3634864

preprocessEntityAddList() kept every type with a generator, so /media/add?ai=1 offered types whose generator has no provider and then showed the upload form. It now also drops a type when AiMediaGeneration::unavailable() says this user cannot use its generator, the check usableTypes() makes for the button. Core already applies the create access part.

Before: the list offers Video, which has no provider.

Before

After: only the types with a usable generator are listed.

After

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