hardcodedSelections from AI Settings Form updates causes tests to fail in any extending modules
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3576320. -->
Reported by: [scott_euser](https://www.drupal.org/user/3267594)
Related to !1261
>>>
<p>[Tracker]<br>
<strong>Update Summary: </strong>[One-line status update for stakeholders]<br>
<strong>Short Description: </strong>[One-line issue summary for stakeholders]<br>
<strong>Check-in Date: </strong>MM/DD/YYYY<br>
<em>Metadata is used by the <a href="https://www.drupalstarforge.ai/" title="AI Tracker">AI Tracker.</a> Docs and additional fields <a href="https://www.drupalstarforge.ai/ai-dashboard/docs" title="AI Issue Tracker Documentation">here</a>.</em><br>
[/Tracker]</p>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<ol>
<li>There is a call to $this->hardcodedSelections in AiSettingsForm but that code does not exist anywhere</li>
<li>Its impossible to track it down because the commit does not contain the issue number but from google search somehow related to <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/ai/issues/3560206" title="Status: Closed (fixed)">#3560206: [meta] Reorganize AI Settings into Capability-Based Table Layout</a></span> or maybe <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/ai/issues/3568026" title="Status: Closed (fixed)">#3568026: Convert AI provider settings form to table layout</a></span></li>
</ol>
<h4 id="summary-steps-reproduce">Steps to reproduce (required for bugs, but not feature requests)</h4>
<p>Use AiSettingsForm, e.g. select a Provider for any operation type, and save. Php warning occurs (unless your environment has them suppressed).</p>
<pre>Warning: Undefined property: Drupal\ai\Form\AiSettingsForm::$hardcodedSelections<br>Drupal\ai\Form\AiSettingsForm->buildForm()() (Line: 130)</pre><h3 id="summary-proposed-resolution">Proposed resolution</h3>
<ol>
<li>Initially wrap it in an isset and merge that to unbreak things</li>
<li>Decide whether to remove it altogether or not (needs background as to why it exists) and possible then merge that</li>
</ol>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<p>MR x2 per above</p>
<h3>Optional: Other details as applicable (e.g., User interface changes, API changes, Data model changes)</h3>
<p>N/A</p>
<h3 id="summary-ai-usage">AI usage (if applicable)</h3>
<p>[ ] AI Assisted Issue<br>
This issue was generated with AI assistance, but was reviewed and refined by the creator.</p>
<p>[ ] AI Assisted Code<br>
This code was mainly generated by a human, with AI autocompleting or parts AI generated, but under full human supervision.</p>
<p>[ ] AI Generated Code<br>
This code was mainly generated by an AI with human guidance, and reviewed, tested, and refined by a human.</p>
<p>[ ] Vibe Coded<br>
This code was generated by an AI and has only been functionally tested.</p>
issue