Patch to add customizable autocomplete path

jrbeeman - October 16, 2007 - 20:37
Project:Textfield Autocomplete
Version:5.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review
Description

I have attached a patch that modifies the textfield autocomplete module to allow a customizable autocomplete path. If the field is left blank, the module behaves as it currently does.

AttachmentSize
textfield_autocomplete-customizable-autocomplete.patch3.7 KB

#1

jrbeeman - October 23, 2007 - 18:00
Status:active» needs review

#2

crooke - September 18, 2008 - 23:55

Hi,

is there any way that the module could check the field's "Allowed values" instead of the values already submitted before? I'm not sure your patch is meant to do that but maybe you have an idea.

Thanks!

#3

vacilando - November 3, 2008 - 12:38

A very useful alternative functionality! Will this be applied in D5 and D6?

#4

markus_petrux - January 11, 2009 - 19:16

I am curious on why would you like to use a different path for the autocomplete feature. As far as I can tell, this is a path that the user will never see.

#5

vacilando - January 11, 2009 - 21:00

It would be most valuable. I wrestle with a site that has close to hundred thousand items to autocomplete here - but they are structured, so if there was a way to pre-define a part (beginning) of the path, it would allow for quicker autocomplete of sub-group of the items. So, in general, this is an easy way (one setting in the content type settings for this field) to limit the number of fetched matches on large sites (and sites, in general, are growing large). Thanks for your efforts in porting this to D6, crossing fingers, you've got my support.

#6

markus_petrux - January 12, 2009 - 07:30

AFAICT, the autocomplete path here is built in the form 'textfield_autocomplete/'. $field['field_name'], and this is similar to other autocomplete paths, such as those used by nodereference, etc.

You just have one menu item defined with the first argument of the path, and the second argument is passed to the menu callback as the first function argument.

Said menu item should be defined as MENU_CALLBACK type, so it is not displayed in any user visible menu.

I still don't see what the benefit is if the site admin can change the first argument of the autocomplete path. If there was something relevant, wouldn't it be a common issue with any other module implementing autocomplete elements?

#7

markus_petrux - January 12, 2009 - 07:54

Further... the patch posted on top would not work unless it is also patched the hook_menu() implementation of the module, and the whole menu caches are forced to rebuild after changing field settings when autocomplete path is changed.

The propossed solution would have to generate different menu items for each field, where we already have one that is able to deal with any field. We would be adding more menu items to the system where it is not really necessary.

 
 

Drupal is a registered trademark of Dries Buytaert.