Issue #3494529: Remove ai_external_moderation form gate

Summary

Removes the ai_external_moderation form gate from the Anthropic provider settings form. The gate is upstream-obsolete: drupal/ai#3479913 (closed fixed 2025-07-29) folded the ai_external_moderation submodule into AI Core and explicitly named this cleanup in its proposed resolution — "Fix so that the settings page in Anthropic provider does not require the module."

Companion issue ai_provider_anthropic#3528947 already fixed the related config-write bug (only writing ai_external_moderation.settings when the module is enabled). This MR finishes that thread by removing the form-side references entirely.

What changed

Pure deletion in src/Form/AnthropicConfigForm.php (52 lines removed, no logic added):

  • Config read of ai.external_moderation and the $hasModeration discovery loop.
  • The has_moderation hidden form value.
  • The moderation-status container linking to the now-obsolete ai.external_moderation_settings route.
  • The "No Moderation Needed" acknowledgment checkbox.
  • The corresponding validateForm() gate.
  • The now-unused use Drupal\Core\Url import.

What did not change

  • No production logic added.
  • No admin UX added — the settings form still saves and still validates the API key against Anthropic's model list.
  • AnthropicProvider.php and all other files untouched.

Relation to prior work

MR !3 by @MrDaleSmith diagnosed this same cleanup in December 2024 targeting the now-abandoned 1.0.x branch stack. That MR is being closed as superseded by this one; the underlying diagnosis was correct — this MR ports the cleanup to the active 1.3.x branch.

How it was verified

Local drupalci-parity gates (runnable locally):

  • composer validate: valid.
  • phpcs (Drupal + DrupalPractice): clean.
  • phpunit full module unit suite: 84 tests, 153 assertions — green.
  • php -l on the edited file: no syntax errors.

Deferred to drupalci pipeline: phpstan (workspace env has an unrelated contrib with a broken autoloader), cspell (not installed locally), PHPUnit concurrent variant, opt-in variants.

AI-Generated: Yes

Used Claude Opus 4.8 to draft this MR description and coordinate the closing of the superseded MR !3 (closed). The underlying deletion is a mechanical maintainer cleanup driven by the upstream tracking issue — no code was AI-generated, only the coordination text. Dependencies, logic, security, and GPL compatibility verified. Full contributor responsibility assumed.

Closes #3494529.

Merge request reports

Loading