VDB: Fix mapping of non-field based multivalue data types
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3579594. --> Reported by: [mxr576](https://www.drupal.org/user/315522) Related to !56 !55 >>> <p>[Tracker]<br> <strong>Update Summary: </strong>[One-line status update for stakeholders]<br> <strong>Check-in Date: </strong>MM/DD/YYYY<br> <strong>Blocked by: </strong>[#XXXXXX] (New issues on new lines)<br> <strong>Additional Collaborators: </strong> @username1, @username2<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> <p>This is a continuation of <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/ai_provider_amazeeio/issues/3555634" title="Status: Closed (fixed)">#3555634: Call to a member function getCardinality() on null in Drupal\ai_provider_amazeeio\Vdb\Postgres\PostgresPgvectorClient-&gt;updateFields() </a></span> and relates to <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/ai_provider_amazeeio/issues/3579505" title="Status: Closed (fixed)">#3579505: VDB: Unable to index multi-valued fields</a></span> and <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-13"><a href="https://www.drupal.org/project/ai/issues/3575992" title="Status: Needs work">#3575992: Indexing breaks with custom SearchAPI DataSource</a></span> about indexing non-content entities with AI search. (This fix and the patch from #3579505 and #3575992 go hand in hand.)</p> <p>Without this change the following error occurred when <code>ListDataDefinition</code> got indexed.</p> <pre>Warning: Array to string conversion in Drupal\ai_provider_amazeeio\Vdb\Postgres\PostgresPgvectorClient-&gt;insertIntoCollection() (line 199 of /var/www/html/web/modules/contrib/ai_provider_amazeeio/src/Vdb/Postgres/PostgresPgvectorClient.php) #0 /var/www/html/web/core/includes/bootstrap.inc(104): _drupal_error_handler_real() #1 [internal function]: _drupal_error_handler() #2</pre><h3 id="summary-proposed-resolution">Proposed resolution</h3> <h3 id="summary-remaining-tasks">Target date or deadline</h3> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <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> > Related issue: [Issue #3555634](https://www.drupal.org/node/3555634) > Related issue: [Issue #3575992](https://www.drupal.org/node/3575992) > Related issue: [Issue #3579505](https://www.drupal.org/node/3579505)
issue