InvalidArgumentException when selecting a tool in the Tools Explorer which has an array property with default value
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3571092. --> Reported by: [rob_e](https://www.drupal.org/user/3350728) Related to !1151 !1224 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>When selecting a tool from the Tools explorer which uses an array property with a default value, the properties form isn't displayed because of the following error: <code>InvalidArgumentException: "0" is an invalid render array key. Value should be an array but got a string. in Drupal\Core\Render\Element::children() (line 97 of /var/www/html/docroot/core/lib/Drupal/Core/Render/Element.php).</code></p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <ul> <li>Define a function call that has a property with a <code>data_type</code> of 'list' and a <code>default_value</code> which is an array</li> <li>Select the tool/function call from the Tools explorer</li> </ul> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Update <code>\Drupal\ai\Service\FunctionCalling\PropertyFormBuilder::formElementFromProperty</code> to check if the default value for the array property type is an array - if it is, implode the default value on to separate lines.</p>
issue