- πΊπΈUnited States dave reid Nebraska USA
I think we should try to get the updated for 8.x-2.x.
- π΅π±Poland gugalamaciek
This patch adds one more feature - "Advanced search" link at the end of autocomplete suggestions. When clicked, it opens entity browser.
- π΅π±Poland gugalamaciek
I added preview improvement. So now, when something is selected you can setup preview of it in widget configuration. How it looks like:
- π§πͺBelgium rp7
Re-rolled against latest 2.x + fixed an issue when copy/paste something in the autocomplete field (this issue was introduced in patch in #31).
- π¨π¦Canada man-1982
Reviewed and tested.
Drupal 10.3
MR was applied without any issue.
Suggest adding MR
thanks - π΅π±Poland gugalamaciek
Minor improvement: The preview remove button form #name was not always unique.
- Status changed to Needs review
7 months ago 12:30pm 30 January 2025 - π§πͺBelgium rp7
Patch in #34 gave me JavaScript issues on Drupal 10.4.6.
event.target.preventDefault();
was being called whereevent.target
was undefined. Appeared an issue with the order of JavaScript being loaded. Added small adjusment to make sure the JavaScript is loaded after autocomplete is initialized. - π©πͺGermany Anybody Porta Westfalica
This functionality would still be really fantastic and a great improvement for Drupal!
Not being forced to decide for the easy and quick autocomplete widget, if you know the label of an entity, but also having the option to alternatively use entity browser alternatively on the same widget, would be absolutely best for more complex use-cases.
On top it would be a dream to have the option to create a new or edit the referenced entity in a modal, but that's a different topic. Having all that would make things really complete and useful!
- π©πͺGermany Anybody Porta Westfalica
PS: Let's switch to using a MR instead of patches! Anyone else interested in pushing this over the finish line?
- First commit to issue fork.
- @grevil opened merge request.
- π©πͺGermany Grevil
Tests fail because of π Fix arguments for tests Active .
- π¨πSwitzerland berdir Switzerland
Based on a very quick test, some first feedback:
* Doesn't seem to work at all on cardinality 1 fields, I'd want to use this for the paragraphs_library paragraph type, which is one of those. I get a button
* should use smaller button classes on Claro/gin, they seem huge.
* add another item and select button to open entity browser are IMHO pretty confusing and not a great user experience. maybe the the entity browser button could be on top, maybe both small next to each other with some guidance on which does what?
* edit doesn't seem to use the same dialog system as the regular entity browser widget(we have the widget pretty heavily customized in our project, with custom edit/delete icons on top of the previews instead of buttons, so I'm not 100% sure if anything affects that, didn't test on plain claro yet)
- π©πͺGermany Grevil
@rp7
Patch in #34 gave me JavaScript issues on Drupal 10.4.6. event.target.preventDefault(); was being called where event.target was undefined.
That is, because there is no event.target.preventDefault(). There is only event.preventDefault(), see https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault.
Manually adjusting the weight in the library is not recommended and messes with code execution timings, which leads to frustrating debugging sessions. Please avoid it.
- π©πͺGermany Grevil
@berdir, thanks for the feedback!
Doesn't seem to work at all on cardinality 1 fields, I'd want to use this for the paragraphs_library paragraph type, which is one of those. I get a button but no autocomplete field
This sounds weird! I have only tested it with target entity type being "node". Could you test the latest MR, if that is still the case now?
should use smaller button classes on Claro/gin, they seem huge.
Definitely. A Colleague of mine could possibly fix up the styling.
add another item and select button to open entity browser are IMHO pretty confusing and not a great user experience. maybe the entity browser button could be on top, maybe both small next to each other with some guidance on which does what?
Ok, I'll take a look on Monday.
edit doesn't seem to use the same dialog system as the regular entity browser widget
Hm, could not reproduce this behavior, but maybe I misunderstand. Could you elaborate
Generally feel free to do some final touches here! This was quite the pain to finalize.
I think the main problem is, that this Widget extends "EntityReferenceAutocompleteBrowserWidget" instead of "EntityReferenceBrowserWidget", and therefore the implementation differs enormously from the original widget.
But this might have a reason, and I am really thankful that this MR was already this far in development. Thanks all! π
Anyway, I think this can get reviewed now. Final touches should still be added. Unsure if we can provide test coverage....
- π©πͺGermany Anybody Porta Westfalica
Thanks @grevil! Great (and really hard) work. Current status attached as static patch.