- πΉπΌTaiwan johnalbin Taipei, Taiwan
This bit me recently. It appears the autocomplete returns the 10 most recent nodes ordered by creation date. So if you created an "About" page a long time ago and then later created 10+ nodes that included the word "about" somewhere in the title, you can no longer see the "About" page in the autocomplete list when typing "About" in the link field. And because you've already typed the exact node title you want, there's no way to make Drupal return that result.
I think Jason β βs solution of sorting by title length is brilliant! Because it means you will always be able to find the node title you want by typing more of the title in the autocomplete.
Here's an example:
- I type "about" in a link field and Drupal returns 10 items sorted by title length:
- About
- About me
- About CSS
- β¦
- About Drupal
- I examine the list to see if what I want is there.
- If what I want is exactly "About", then it's the first option!
- If what I want is longer than "About Drupal", it's not in that list and I'll have to type more letters into the link field.
- I didn't want anything in that first list, so I type "about my" and Drupal returns a new list of 10 items sorted by title length:
- About my job
- About my dog
- About my team
- About my dreams
- About my team's dogs
- β¦
- About Mycenaean Greece
- I repeat step 2, type "about my dog", and see the desired title, "about my dog's favorite chew toy".
The only problem this solution doesn't solve is if you have 11 nodes all named "About" exactly, but I think that's a content problem, not one Drupal needs to account for.
I've updated the issue summary to show the proposed solution and (hopefully) to make it easier to understand the problem.
- I type "about" in a link field and Drupal returns 10 items sorted by title length:
- πΉπΌTaiwan johnalbin Taipei, Taiwan
Oh! I forgot to mention this happens when editing menu links too. So it doesn't happen in just the link field's autocomplete.
- π¬π§United Kingdom lincoln-batsirayi
The hook on #3 by @matthiasm11 has worked for me, a good placeholder until a more firm decision has been made on this issue.
- π¨πΏCzech Republic parisek
We have same issue and #3 fixed it for us, thank you
- π¨π¦Canada phjou Vancouver π¨π¦ πͺπΊ
Wa had the same issue, hook #3 seems to do the trick, thanks!