Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When using the autocomplete widget and I search for "Document Title" I see all entities matching "Document title", however I only see 10 at a time. In my use case I am connecting multiple documents to an event content type. Could we list more than 10 items at a time? At first glance it seemed as though the field could not find the nodes, some people will be confused.
Comment | File | Size | Author |
---|---|---|---|
#26 | 2185019-26.patch | 2.6 KB | joelpittet |
| |||
#25 | entityreference-autocomplete_max_results-2185019-25.patch | 2.15 KB | estebanvalerio.h |
| |||
#23 | autocomplete_field-2185019-23.patch | 2.55 KB | vinmassaro |
| |||
#3 | entityreference-autocomplete_max_results-2185019-3.patch | 2.1 KB | fbrooks |
| |||
entityconnect-feature-request-more-autocomplete-items.png | 48.08 KB | CMStom |
Comments
Comment #1
jygastaud CreditAttribution: jygastaud commented@thoughmas,
I'm moving that issue to Entity Reference too as it's not concern directly Entity connect.
Comment #2
aniebel CreditAttribution: aniebel commentedI would consider this a fairly important request since it appears that there are 10 or fewer results while in reality, it could be a lot more.
Comment #3
fbrooks CreditAttribution: fbrooks commentedI am providing a patch for consideration that contains this functionality.
Thanks
Comment #4
nategasser CreditAttribution: nategasser commentedPatch in #3 worked great, thanks.
Comment #5
gazzur CreditAttribution: gazzur as a volunteer commentedPatch #3 works fine for me.
Comment #6
saniyat CreditAttribution: saniyat commentedPatch #3 works perfectly.
Comment #8
Kris77 CreditAttribution: Kris77 commentedPatch #3 works fine for me too.
I use EntityReference 7.x-1.1 and Drupal 7.50
Comment #9
MustangGB CreditAttribution: MustangGB commentedNice idea, test failure was unrelated to the patch and a re-run now passes fine, so marking RTBC as per #6.
Comment #10
spotzero CreditAttribution: spotzero at Coldfront Labs Inc. commentedThis throws a warning unless you re-save everything.
Notice: Undefined index: max_results in entityreference_autocomplete_callback_get_matches() (line 1063 of /var/www/html/drupal/sites/all/modules/entityreference/entityreference.module).
Comment #11
NWOM CreditAttribution: NWOM commented#3 worked perfectly. Thank you!
Comment #12
dani3lr0se CreditAttribution: dani3lr0se at Kalamuna commented#3 worked well for me as well. Thanks! I'm going to change this back to reviewed and tested by the community since it worked without any issues.
Comment #13
minorOffense CreditAttribution: minorOffense at Coldfront Labs Inc. commentedI haven't seen anyone address @spotzero's warnings. Putting back to needs work.
Comment #14
fbrooks CreditAttribution: fbrooks commented@spotzero can you provide the steps for recreating the warning?
Thanks
Comment #15
spotzero CreditAttribution: spotzero at Coldfront Labs Inc. commentedJust make sure that "$settings['max_results']" exists before using it, because it doesn't exist until the setting form is re-saved.
Comment #16
fbrooks CreditAttribution: fbrooks commentedI am unable to reproduce the warning on 7.54 with the latest 7.x-1.x-dev of entityreference. I created a content type, added an entityreference field, applied the patch, and then edited the entityreference field's settings. I am seeing no warnings.
@spotzero, could you retry with the HEAD of 7.x-1.x?
Thanks
Comment #17
FrancescoQ CreditAttribution: FrancescoQ commentedI applied #3 and i had the warnings, but everything went fine after flushing all cache.
I think the issue simple was that without flishing the caches the field doesn't read the default of 10 elements to show (the field was empty until the flush, but showed '10' after the flush)
I think this is RTBC
Thanks!
@spotzero if you download entityreference, apply patch, then create fields everything goes right first try, i think the issue exists only for already existing fields.
Comment #18
Alex72RM CreditAttribution: Alex72RM commentedHope to have the patch applied to -dev ;)
Comment #19
MustangGB CreditAttribution: MustangGB commentedPatch does apply against dev, and that's not what the "Patch (to be ported)" status is for either, so restoring status.
Comment #20
joep.hendrix CreditAttribution: joep.hendrix at CompuBase Internet Solutions commentedPatch #works fine, please commit
Comment #21
minorOffense CreditAttribution: minorOffense at Coldfront Labs Inc. commentedTo avoid warnings after applying the patch, if all that's required is a cache clear, we'll need an update hook to trigger a cache clear (technically speaking update.php should clear the cache anyways so we could get away with an "empty" update hook but I'd prefer an explicity cache clear call).
Moving to "needs work" so we can add the update hook.
Comment #22
bramvandenbulcke CreditAttribution: bramvandenbulcke commentedI wanted to change the autocomplete output to 50 on a website with different related content fields. I only needed to change the value under 'Get an array of matching entities' from 10 to 50:
Comment #23
vinmassaro CreditAttribution: vinmassaro commented@minorOffense: here is an updated patch that flushes caches in an update hook. Thanks!
Comment #24
squarecandy CreditAttribution: squarecandy commented#23 works great. Thank you.
Comment #25
estebanvalerio.h CreditAttribution: estebanvalerio.h commentedSince DEV version was updated today, patch #3 was giving errors due to lines mismatch, here's an update for patch #3.
Comment #26
joelpittet@estebanvalerio.h not sure if you meant to remove the cache clear form #23, but here's a patch that is a bit more specific and less drastic of a clear.
field_info_cache_clear();
instead ofdrupal_flush_all_caches();
LMK if it needs more clearing.
Comment #27
ultrabob CreditAttribution: ultrabob commentedI tested #26 in desktop browsers and smartphone. Because I applied a patch I still had to clear cache to avoid errors showing up, but once I cleared cache it worked like a charm everywhere I tested it.
Comment #28
scotwith1t+1 for this one! Let's get it in and 1.6 release out! :)
Comment #29
minorOffense CreditAttribution: minorOffense at Coldfront Labs Inc. commentedWe still need a test to validate the functionality. If anyone is feeling keen enough to add the test.
Comment #30
welly CreditAttribution: welly at Axis12 Limited commentedIgnore me, it's fine.
Comment #31
welly CreditAttribution: welly at Axis12 Limited commentedComment #32
darkodev CreditAttribution: darkodev commentedIsn't this already addressed here? https://www.drupal.org/project/entityreference/issues/1700112
We've been using that patch for a while and it works great.
Comment #33
joelpittetThanks for pointing that out, the other one is better but missing entityreference_field_widget_info changes that this one is, and the cache clear.
Closing as a duplicate of #1700112: Entity reference list View Pager: Items to display is broken