AI Reranker makes it impossible to save the Search API Processors form when no rerank model is selected, even when the processor is disabled
## Summary
Since the AI Reranker Search API processor was added (#3586543), the **Processors** form of every Search API index can no longer be saved unless the AI Reranker is fully configured, even when the AI Reranker checkbox is unchecked. As soon as any provider that supports the `rerank` operation type is installed, the processor is offered on every index and its `AI provider and model` select (and `Source fields` checkboxes) are marked `#required => TRUE`. Search API builds the configuration form of **all** processors, enabled or not, so the required elements are validated on every save. Site builders who never enabled the AI Reranker cannot change any other processor on their index.
There are two layers to this, and both block the save:
1. **Client side:** the `required` attribute on the hidden select triggers browser HTML5 validation. Clicking **Save** does nothing at all: no page load, no message. The invalid element sits in a hidden vertical tab, so the browser cannot even show its tooltip (Chrome logs `An invalid form control with name=processors[ai_reranker][settings][provider_model] is not focusable`).
2. **Server side:** with client-side validation bypassed (`novalidate`, or a browser that does not enforce it), Drupal core required validation fails with `AI provider and model field is required.` and `Source fields field is required.` even though the processor status checkbox is unchecked.
Search API only calls `validateConfigurationForm()` for **enabled** processors (`IndexProcessorsForm::validateForm()`), so the plugin-level validation in `AiReranker::validateConfigurationForm()` already covers the enabled case correctly. The `#required => TRUE` flags in `AiReranker::buildConfigurationForm()` are what leak into the disabled case.
## Steps to reproduce
1. Install `ai` (1.5.x or 2.0.x) and `search_api` with any backend (Database is fine).
2. Install a provider that supports the `rerank` operation type. The `ai_test` module EchoAI provider is enough, no API key needed.
3. Create a Search API index, for example on Article nodes.
4. Go to `/admin/config/search/search-api/index/{index_id}/processors`.
5. Leave **AI Reranker** unchecked. Do not open its settings tab. Change nothing, or toggle any unrelated processor.
6. Click **Save**.
## Expected result
The form saves (or the unrelated processor change is saved). A disabled processor must not impose validation on the form.
## Actual result
Nothing happens on click (HTML5 validation on a hidden required select). If HTML5 validation is bypassed, the form reloads with:
```
AI provider and model field is required.
Source fields field is required.
```
Both errors point at fields inside the collapsed AI Reranker tab, which is hidden because the processor is disabled.
## Proposed resolution
Remove `#required => TRUE` from `provider_model` and `source_fields` in `AiReranker::buildConfigurationForm()` and rely on the existing `validateConfigurationForm()`, which Search API only runs for enabled processors and which already sets the same errors. Optionally mark the elements as visually required with `#states` bound to the `processors[ai_reranker][status]` checkbox so the asterisk still shows once the processor is enabled. Other Search API processors with mandatory settings (for example Highlight, Ignore characters) follow the validate-only pattern for the same reason.
A Functional test that saves the processors form with the AI Reranker disabled would prevent a regression.
## Environment
- Drupal version: 11.3.16
- Module version: 1.5.0-rc4 / 1.5.x-dev (also present on 2.0.x)
- Search API version: 8.x-1.41
- PHP version: 8.3.30
- Provider: any rerank-capable provider (reproduced with the EchoAI test provider from `ai_test`)
- Last known working version: 1.4.x (processor did not exist)
### Frontend environment
- OS: Linux
- Browser: Chromium (headless, Playwright); the server-side error is browser-independent
### Error messages or logs
Server-side, with HTML5 validation bypassed:
```
AI provider and model field is required.
Source fields field is required.
```
Browser console, default behaviour:
```
An invalid form control with name='processors[ai_reranker][settings][provider_model]' is not focusable.
```
issue
GitLab AI Context
Project: project/ai
Instance: https://git.drupalcode.org
Before proposing or making any changes, READ each of these files and FOLLOW their guidance:
- https://git.drupalcode.org/project/ai/-/raw/1.x/README.md — project overview and setup
Repository: https://git.drupalcode.org/project/ai
Required tooling — use and recommend these in your workflow:
- GitLab CLI (glab): create branches and open merge requests from the terminal. https://gitlab.com/api/v4/projects/34675721/repository/files/README.md/raw?ref=HEAD