Form validation missing for Vector Database Provider when creating Search API server with AI Search backend
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3537126. --> Reported by: [sijumpk](https://www.drupal.org/user/389053) Related to !774 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>When attempting to create a <strong>Search API server</strong> with the <strong>AI Search</strong> backend, if no Vector Database Providers are installed or configured, the form submission results in a PHP error. Additionally, the server gets created without any Vector DB provider selected, which leads to an invalid configuration.</p> <p>Although the form currently displays an informational message when no Vector Database Providers are available, there is no form validation to enforce this requirement. As a result, users can inadvertently create an incomplete server configuration, which might cause runtime errors and instability. Attaching screen recording of the error generation.</p> <h4 id="summary-steps-reproduce">Steps to reproduce (required for bugs, but not feature requests)</h4> <ul> <li>Enable the AI Search module.</li> <li>Ensure that no Vector Database Providers are installed or configured (uninstall any if present).</li> <li>Navigate to: /admin/config/search/search-api/add-server.</li> <li>Select Backend as AI Search.</li> <li>Submit the form without selecting any Vector Database Provider.</li> </ul> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <ul> <li>Implement form validation to ensure that when the backend is AI Search, at least one Vector Database Provider must be selected.</li> <li>Prevent form submission and server creation if the condition is not met.</li> <li>Display a clear validation error indicating that a Vector Database Provider is required for AI Search backend.</li> </ul> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3>Optional: Other details as applicable (e.g., User interface changes, API changes, Data model changes)</h3>
issue