Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
It appears that Entity Reference has the same problem as Nodereference
http://drupal.org/node/998494
When creating an entity reference view, the pager will always display 10 items no matter what number you give it. It will also display all but that is undesired for long lists.
Comments
Comment #1
lsolesen CreditAttribution: lsolesen commentedIs this still a problem for the latest dev?
Reformatting the link #998494: Node Reference field always displaying 10 results when using the Advanced View option. [views-6.x-3.x]
Comment #2
iLLin CreditAttribution: iLLin commentedYes its still a problem and not sure why you linked to CCK 6.x version either? I can change to show all results and it will show everything. If I put it to display 30 results, the autocomplete still only shows 10 results. Doesn't matter the number, its always 10 if there's 10+ to show.
Comment #3
soulston CreditAttribution: soulston commentedIt seems to be down to the "10" here:
I'm sure there is a way to override this with a view alter hook somehow.
At the very least could this number be:
Comment #4
vlkff CreditAttribution: vlkff commentedI created a patch that should solve an issues with number of items of autocomplete list.
It is implementing an option to set it directly for simple mode, and it using views settings for entityreference view mode.
Comment #6
achtonThe patch in #4 works for me. However, it was not correctly formatted according to guidelines, so I did that, and also adjusted the wording and comments slightly. No functional change.
Comment #7
RoSk0Looks good and work.
@achton: Whenever you modifying patch attach you should attach interdiff together with new patch version.
Comment #8
t_en CreditAttribution: t_en commentedGood to see this solved! I have applied the patch #6 (to entityreference 7.x-1.1), and can verify that the patch works.
Comment #9
jedsaet CreditAttribution: jedsaet commentedConfirming that #6 works with 7.x-1.1.
+1 RTBC.
Comment #10
John Pitcairn CreditAttribution: John Pitcairn commentedConfirmed, #6. Does this need to go upstream to D8 core entityreference?
Comment #11
jaydub CreditAttribution: jaydub commentedCame across this issue as I have the same need to allow Views result count settings to bubble up to the entityreference autocomplete. Patch applies and works as expected.
Comment #12
rocketeerbkw CreditAttribution: rocketeerbkw commented#6 still applies cleanly to 7.x-1.x
Comment #13
lucidwayn CreditAttribution: lucidwayn commentedgreat thanks! #6 works (applied to version 7.x-1.1) and an extra option appears when editing the field settings ("Autocomplete entities limit").
Comment #14
ikeigenwijs CreditAttribution: ikeigenwijs commentedRTBC++
a scrollable List field would be even better, there is a module for that i think.
Comment #15
drummComment #16
Anonymous (not verified) CreditAttribution: Anonymous commentedCan we get this functionality implemented for the other widgets as well? Select lists and Checkboxes still display all regardless of views display settings.
Comment #17
kopeboy CreditAttribution: kopeboy commentedI patched and couldn't see any change on the Views Entity Reference list neither on the Select list/Checkboxes widgets using the new "Autocomplete entities limit" setting.
Entity selection Mode: View
Display a specified number of items doesn't work. In the View display I have (for example) 3 results, in the ER field on the node form I have ALL items, even more than 10.
Entity selection Mode: Simple
Setting Autocomplete entities limit to 3 won't work if you have a select list or checkbox as the widget: it will show ALL items like above
Actually the problem on the View is a bug, because the setting to specify items is there.
On a module so important with a stable release since 4 years... please take a look on this!
Comment #18
kopeboy CreditAttribution: kopeboy commentedComment #19
kopeboy CreditAttribution: kopeboy commentedComment #20
DamienMcKennaComment #21
cilefen CreditAttribution: cilefen commentedA reroll, I didn't manually test this yet.
Comment #23
cirrus3d CreditAttribution: cirrus3d commentedI can confirm this works without an issue using:
Entityreference 7.x-1.5
Views 7.x-3.18
Thanks for the reroll!
Comment #24
ikeigenwijs CreditAttribution: ikeigenwijs commentedI can confirm this works
Checking patch entityreference.module...
Checking patch plugins/selection/EntityReference_SelectionHandler_Generic.class.php...
Applied patch entityreference.module cleanly.
Applied patch plugins/selection/EntityReference_SelectionHandler_Generic.class.php cleanly.
thx
Comment #25
jelo CreditAttribution: jelo commentedWorks great. Would be fantastic to see the patch committed! Thanks
Comment #26
joelpittetSetting the status based on the review from @jelo in #25 and comparing the reroll and the previous and reading through the logic.
Comment #27
mrgoodfellow CreditAttribution: mrgoodfellow commentedI have applied this patch and have not identified any issues.
Comment #28
darkodev CreditAttribution: darkodev commentedAlso using this patch with no issues.
Comment #29
Vacilando CreditAttribution: Vacilando as a volunteer commentedI also confirm that the patch in #21 solves this issue flawlessly. We are using it on a production site without any issues.
Could this please be accepted into the dev version of the D7 Entityreference module so that we don't have to keep patching...
Comment #30
Vacilando CreditAttribution: Vacilando as a volunteer commentedBump... ;-)
Comment #31
Vacilando CreditAttribution: Vacilando as a volunteer commentedThis patch works for everyone using it since 4 years.
Can someone please commit it to the dev branch at least, please.
Comment #32
minorOffense CreditAttribution: minorOffense at Coldfront Labs Inc. commentedThere are a few things I noticed after review:
If those issues can be resolved I'd be glad to merge it in.