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

  1. Attempt to use on another node bundle
  2. 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

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ayrmax created an issue. See original summary.

scott_euser’s picture

Title: Field widget action is limited to a certain node type » Field widget action is limited to a certain node type and only on edit form
Issue summary: View changes

scott_euser’s picture

Status: Active » Needs review

Thanks for spotting! That should do it + also work on node create now as well

scott_euser’s picture

Status: Needs review » Fixed

Added to merge train

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • scott_euser committed 55f16a86 on 1.0.x
    fix: #3583886 Field widget action is limited to a certain node type and...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.