Problem/Motivation

with Drupal 9.2.2 i can't save content with autocomplete widget throw an error

This entity (taxonomy_term: XX) cannot be referenced.

screen error

Steps to reproduce

  1. Create a field with autocomplete widget
  2. Enable Entity Autocomplete Suggestions moule
  3. Edit / add content
  4. Try to save content

Comments

berramou created an issue. See original summary.

rajkumar7it74’s picture

Hi @berramou,

I have followed steps mentioned. I am not able to reproduce the error. Please give more steps to reproduce.

Please see my screenshots attached.

Thanks

berramou’s picture

Hello @rajkumar7it74

Thank you for you quick reply!
I know the reason why, because autocomplete suggest all terms of all vocabulary and when you choose another vocabulary other than the one selected for your field cause that issue here is an example with Drupal 9.2.2 fresh install

  1. Content type article
  2. Tags vocabulary
  3. Types vocabulary

in article add form i get this
screen error

The tags field accept only Tags vocabulary so if i choose Type 1 for example and try to save i get the error:
screen error

I don't know if this issue related to this module or core !

berramou’s picture

StatusFileSize
new19.66 KB

Yes this issue caused by this module, because when i disable it i get only Tags vocabulary suggested!
screen error

berramou’s picture

Can you please review this patch!

rajkumar7it74’s picture

Hi @berramou,

"entity_autocomplete_suggestions_3225707-5.patch" Patch looks good and working fine.

Thanks for patch.

berramou’s picture

You are welcome @rajkumar7it74
you tested it with Drupal 8 ? i made this patch for Drupal 9.2.2, if it's working can you commit it and create new release please !
Thank you again !

rajkumar7it74’s picture

Status: Active » Patch (to be ported)

Hi @berramou,

I have validated this patch with Drupal 8 version 8.9.17. The patch is working fine.

I'll release new version with this patch.

Thanks

berramou’s picture

Okay cool,
can you commit it with the issue commit message !
thank you !

rajkumar7it74’s picture

Status: Patch (to be ported) » Fixed

Hi @berramou,

New version 8.x-2.3 released with this patch fix.

Thanks

berramou’s picture

Thank you @rajkumar7it74 !

berramou’s picture

Status: Fixed » Closed (fixed)