TypeError in AutomatorBaseAction::getAutomatorsOptions() when automating base fields
## Summary Currently `AutomatorBaseAction::getAutomatorsOptions()` requires a `$bundle` to be passed in to retrieve the options for a field. The bundle is available for regular fields added through the field API, but base fields are not associated with a bundle (since base fields apply to all bundles). This can cause a fatal `TypeError` to be thrown when calling code cannot supply a bundle. For example when `AutomatorBaseAction::isAvailable()` is called for an automator associated with a base field. ## Steps to reproduce 1. Create an "Article" node type. 2. Enable the [Base Field Override UI](https://www.drupal.org/project/base_field_override_ui) module. 3. Go to the Base Field Override UI for the "article" node type: /admin/structure/types/manage/article/fields/base-field-override 4. Add a Base Field Override to the "Title" field and save. 5. Edit the "Published" field override and configure the new "Enable AI Automator" section and save. 6. Go to the manage form display (admin/structure/types/manage/article/form-display), edit the Title field, expand the Field Widget Actions and add + enable an "Automator Text Suggestion" and make sure the "Title default" automator is chosen. Save. 7. Now invoke `AutomatorBaseAction::isAvailable()` on the automator. ``` drush php:eval '$efm = \Drupal::service("entity_field.manager"); $title = $efm->getBaseFieldDefinitions("node")["title"]; $mgr = \Drupal::service("plugin.manager.field_widget_actions"); $action = $mgr->createInstance("automator_text", []); $action->setFieldDefinition($title); var_dump($action->isAvailable());' ``` ## Expected result ``` bool(true) ``` ## Actual result ``` TypeError: Drupal\ai_automators\Plugin\FieldWidgetAction\AutomatorBaseAction::getAutomatorsOptions(): Argument #2 ($bundle) must be of type string, null given ``` ## Environment - Drupal version: Any - Module version: 1.x - PHP version: Any - Provider: Any ### Error messages or logs ``` TypeError: Drupal\ai_automators\Plugin\FieldWidgetAction\AutomatorBaseAction::getAutomatorsOptions(): Argument #2 ($bundle) must be of type string, null given, called in /var/www/html/web/modules/contrib/ai/modules/ai_automators/src/Plugin/FieldWidgetAction/AutomatorBaseAction.php on line 185 in Drupal\ai_automators\Plugin\FieldWidgetAction\AutomatorBaseAction->getAutomatorsOptions() (line 201 of modules/contrib/ai/modules/ai_automators/src/Plugin/FieldWidgetAction/AutomatorBaseAction.php). Drupal\ai_automators\Plugin\FieldWidgetAction\AutomatorBaseAction->isAvailable() (Line: 328) Drupal\field_widget_actions\Hook\FieldWidgetAction->fieldWidgetSingleElementFormAlter() (Line: 460) Drupal\Core\Extension\ModuleHandler->alter() (Line: 475) Drupal\Core\Field\WidgetBase->formSingleElement() (Line: 222) Drupal\Core\Field\WidgetBase->formMultipleElements() (Line: 120) Drupal\Core\Field\WidgetBase->form() (Line: 197) ```
issue