I have made a small change to the profile module which will allow the admin to configure a text field as an autocomplete field so that users can choose from options that have already been used.

This is a first draft as I need some help with the pgsql update, as I wasn't sure how I am suppose to do this, and also if there is interest I could add in like taxonomy so that mutliple values can be entered with a comma separting them.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gordon’s picture

FileSize
4.35 KB

Here is an update to the original patch which brings it upto date.

Tobias Maier’s picture

I just reviewed your patch and I think there needs to be a check in profile_autocomplete() if the requested field has autocomplete activated and if the user has access to this view/edit profile in general

but maybe I missed something...

cu Tobi

gordon’s picture

FileSize
4.5 KB

I have updated the patch so that the autocomplete checks to make sure the field has autocomplete enabled.

I also fixed up the pgsql update.

Dries’s picture

Status: Needs review » Needs work

1. The last part seems to be missing some code. There is no checkbox on the textfield creation form.

2. Write 'Auto-complete' not 'Auto Complete' (no caps).

3. I think we need to explain 'Auto-complete' so that our father Boris knows what this implies. ;-)

Otherwise looks like an interesting patch! Cool.

gordon’s picture

Status: Needs work » Needs review
FileSize
5.1 KB

The field for updating the Auto-complete was there. Well it is back now.

Dries’s picture

Status: Needs review » Needs work

The value of the checkbox doesn't get saved (and the textfield is always a regular textfied).

gordon’s picture

Status: Needs work » Needs review
FileSize
7.66 KB

This time, I think it is all back in the patch.

Dries’s picture

Status: Needs review » Needs work

When I create a field, I get:

user warning: Column count doesn't match value count at row 1 query: INSERT INTO profile_fields (title, name, explanation, category, type, weight, required, register, visibility, autocomplete, options, page) VALUES ('test', 'profile_test', 'test', 'test', 'textfield', 0, 0, 0, 2, '1', '')

Did you test this?

gordon’s picture

Status: Needs work » Needs review
FileSize
7.67 KB

I can't believe I missed that. I was testing the updates and not the insert.

Sorry about that.

Dries’s picture

Status: Needs review » Fixed

Committed to HEAD. Thanks. (Still had to fix another bug ...)

Anonymous’s picture

Status: Fixed » Closed (fixed)