- 🇺🇸United States dasginganinja Bethlehem, PA
I have tested the latest patch #6 and it doesn't work with Drupal 9.5.9.
I observe the same error upon form submission.
- First commit to issue fork.
- Open on Drupal.org →Core: 10.0.7 + Environment: PHP 8.1 & MySQL 8last update
about 1 year ago Waiting for branch to pass - Status changed to Needs review
about 1 year ago 3:08pm 6 June 2023 - Open on Drupal.org →Core: 10.0.7 + Environment: PHP 8.1 & MySQL 8last update
about 1 year ago Waiting for branch to pass - Open on Drupal.org →Core: 10.0.7 + Environment: PHP 8.1 & MySQL 8last update
about 1 year ago Waiting for branch to pass - Open on Drupal.org →Core: 10.0.7 + Environment: PHP 8.1 & MySQL 8last update
about 1 year ago Waiting for branch to pass - Open on Drupal.org →Core: 10.0.7 + Environment: PHP 8.1 & MySQL 8last update
about 1 year ago Waiting for branch to pass - 🇸🇮Slovenia gombi
I was unable to reproduce the issue described by Nicolas and the patch #6 appears to work for me on Drupal 9.5.9 as well.
I did, however, encounter an issue with it when using "Views: Filter by an entity reference view". When using the patch, the field was ignoring the view and instead always displaying the results in the form of "Title - (ID)". I don't believe this to be the desired effect.
I've modified the patch to only add the entity id inside brackets when editing an existing Entity.
Moving this to needs review, but as I was unable to reproduce the issues described above, the patch might require some additional work.
- 🇸🇦Saudi Arabia martins.bruvelis Thuwal
It seems that the
item.label
in with the addition ofid
in the label doesn't get parsed correctly when the label contains special characters, such as "comma" an "double quotes". Usingthis.value
as the label, seems to solve the issue. Additionally, the (id) can be removed from being displayed to the end users by removing theid
inside the brackets at the end of the string inassets/js/autocomplete_delux.js
by replacing:this.element = $( '<span class="autocomplete-deluxe-item">' + item.label + "</span>" );
with:
// Use value as label because of the double quote and comma character encoding. // Then remove the entity id in bracketsfrom the end of string. const noLabelId = this.value.replace(/[ ]\([^()]+\)(?=[^()]*$)/gi, ""); this.element = $( '<span class="autocomplete-deluxe-item">' + noLabelId + "</span>" );
- Open on Drupal.org →Core: 10.0.7 + Environment: PHP 8.1 & MySQL 8last update
about 1 year ago Waiting for branch to pass - 🇺🇸United States caspervoogt
For what it's worth, I ran into this ("There are no taxonomy terms matching "my new term name") on D10 and the patch from #6 didn't help.
- 🇸🇦Saudi Arabia martins.bruvelis Thuwal
Comment #24 🐛 Autocomplete deluxe widget doesn't work for multiple entity reference field when you add new terms and some terms are existing Needs review caspervoogt →
Is the issue still present if you use the plain diff patch from Merge Request !10 mergeable?
- 🇺🇸United States caspervoogt
@martins.bruvelis I just tested that plain diff and get the same error; 'There are no taxonomy terms matching "testingignore" when I tried adding a new term called "testingignore" using the Autocomplete widget. My widget is configured to allow new terms.
- 🇧🇪Belgium DieterHolvoet Brussels
This seems to work as long as you enable both the Allow new terms widget option and the Create referenced entities if they don't already exist field option provided by Drupal core. I suggest we get rid of the Allow new terms widget option since it's redundant.
- Status changed to Needs work
8 months ago 10:26am 13 November 2023 - 🇦🇺Australia AlMunnings Melbourne
MR10 has helped fix errors with an entity reference taxonomy term with brackets in the title, in my usage.
- Status changed to Needs review
6 months ago 12:08pm 29 December 2023 - 🇺🇦Ukraine sickness29
I have removed setting from module and only left it in element to pass entity reference's setting there.
Tested adding both existing and new terms on clean Drupal and seen no issues - 🇧🇪Belgium borisson_ Mechelen, 🇧🇪
@sickness29, I think it would be better to add to the already open Merge Request, so we can clearly see the change you've made?
- 🇺🇦Ukraine sickness29
Hi @borisson_
I am fixing the issue described in task and it is "widget does not work when you add new terms and some terms are existing".
When you apply this patch the issue is non existent as it was not obvious for people that there is second setting in widget to allow creating new items.
This is also confirmed #27, so the only issue is odd setting, removed it leaving only the default one which comes from entity reference field.The merge request has nothing to do with my fix. I think it tries to fix another issue which are "widget does not work when you try to resave field with label with brackets" which is fixed here https://www.drupal.org/project/autocomplete_deluxe/issues/3350796#commen... 🐛 Using terms with brackets in their name breaks Autocomplete Deluxe Needs review
- Merge request !14Removed option to create new terms; use entityreference's option instead → (Merged) created by sickness29
-
sickness29 →
committed 9ce9e512 on 2.0.x
Issue #3053986 by sickness29, manuga, aditya.ghan, rksyravi, Rajab...
-
sickness29 →
committed 9ce9e512 on 2.0.x
- Status changed to Fixed
about 2 months ago 2:55pm 6 May 2024 Automatically closed - issue fixed for 2 weeks with no activity.