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.
Hi,
I figured out that taxonomy_manager_autocomplete_load has a query, where range is hardcoded to 30. So whenever I use that I can see only 30records, if there is more than 30 records it simply ignores that. Is there any way to show all the records? I have herewith added part of a code from taxonomy manager module.
// Select rows that match by term name.
$tags_return = $query
->fields('t', array('tid', 'name'))
->condition('t.vid', $vid)
->condition('t.name', '%' . db_like($last_string) . '%', 'LIKE')
->range(0, 30)
->execute()
->fetchAllKeyed();
Thank you
Comments
Comment #2
ziomizar CreditAttribution: ziomizar as a volunteer and at Station, East Atlantic Engineering commentedThats seems fine, you don't want to load the whole list of terms (talking about thousands of terms).
To get a more restricted list of words in autocomplete you should just write a more specific word.
Comment #3
rojan raj CreditAttribution: rojan raj commentedYes I tried that too but its restricting me to only 30 records.
Lets say, I have a 50 term with name "drupal". if I write drupal autocomplete suggestions will give me only 30records.
Comment #4
rojan raj CreditAttribution: rojan raj commentedJust a simple patch to configure range in query while autocompleting terms.
Comment #5
ziomizar CreditAttribution: ziomizar as a volunteer and at Station, East Atlantic Engineering commentedrange_limit seems too generic as variable name, a better name would include also taxonomy_manager in the name.
This solution solve the problem just for the advanced users, is better than an hardcoded value but still not configurable for most users.
Comment #6
ziomizar CreditAttribution: ziomizar as a volunteer and at Station, East Atlantic Engineering commentedComment #7
rojan raj CreditAttribution: rojan raj commentedComment #8
ziomizar CreditAttribution: ziomizar as a volunteer and at Station, East Atlantic Engineering commentedComment #9
lhguerra CreditAttribution: lhguerra at Taller commentedIn drupal 8 this is even worse, the limit is 10 and the autocomplete is the only way to search, it's not like I could press enter and see a search result with pagination. I'm almost giving up and creating a custom view
Comment #10
lhguerra CreditAttribution: lhguerra at Taller commentedI found where I could patch this to increase the limit, I don't think it's a very good patch since it is not configurable but it might help someone.