Problem/Motivation
The field widget action plugin "Suggest from existing terms (Form)" is currently limited to a certain node form with id: "node_article_edit_form"
Drupal\ai_auto_reference\Plugin\FieldWidgetAction\AiAutoReferenceFormSuggestion::buildModalForm()
public function buildModalForm(array $form, FormStateInterface $form_state, ContentEntityInterface|NULL $entity): array {
if ($this->requestStack->getCurrentRequest()->request->get('form_id') !== 'node_article_edit_form') {
return $form;
}
Steps to reproduce
- Attempt to use on another node bundle
- Attempt to use on node create
Proposed resolution
- Remove article edit check
- Render edit form content when node does not yet exist
Remaining tasks
MR
User interface changes
AI auto reference is now available on non-article + on article (and non-article) create
API changes
N/A
Data model changes
N/A
Comments
Comment #2
scott_euser commentedComment #4
scott_euser commentedThanks for spotting! That should do it + also work on node create now as well
Comment #5
scott_euser commentedAdded to merge train