Custom field automator compatibility with version 4.0
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3550437. --> Reported by: [a.dmitriiev](https://www.drupal.org/user/3235287) Related to !934 >>> <p>--- AI TRACKER METADATA ---<br> Update Summary: Custom field automator compatibility with version 4.0<br> Check-in Date: MM/DD/YYYY (US format) [When we should see progress/get an update]<br> Due Date: MM/DD/YYYY (US format) [When the issue should be fully completed]<br> Blocked by: [#XXXXXX] (New issues on new lines)<br> Additional Collaborators: @username1, @username2<br> AI Tracker found here: <a href="https://www.drupalstarforge.ai/">https://www.drupalstarforge.ai/</a><br> --- END METADATA ---</p> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>I am not sure whether the same problem occurs with Custom Field module version 3.x, but with version 4.x the method <code>extraAdvancedFormFields</code> in <code>modules/ai_automators/src/PluginBaseClasses/CustomField.php</code> throws an error like this:</p> <blockquote><p>TypeError: Drupal\Component\Utility\Html::escape(): Argument #1 ($text) must be of type string, null given, called in /var/www/html/web/core/lib/Drupal/Component/Render/FormattableMarkup.php on line 238 in Drupal\Component\Utility\Html::escape() (line 433 of /var/www/html/web/core/lib/Drupal/Component/Utility/Html.php). </p></blockquote> <h4 id="summary-steps-reproduce">Steps to reproduce (required for bugs, but not feature requests)</h4> <p>Install AI Automators (AI Core 1.2.x latest)<br> Install Custom Field module (4.x)<br> Create a custom field on any entity type<br> Try to add an AI automator to this field<br> Observe the error in logs</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Assume that <code>widget_settings</code> could be empty and rely on property key, not the label</p>
issue