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.
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.
Comment | File | Size | Author |
---|---|---|---|
#9 | profile_ac.patch_3.txt | 7.67 KB | gordon |
#7 | profile_ac.patch_2.txt | 7.66 KB | gordon |
#5 | profile_ac.patch_1.txt | 5.1 KB | gordon |
#3 | profile_ac.patch_0.txt | 4.5 KB | gordon |
#1 | profile_ac.patch.txt | 4.35 KB | gordon |
Comments
Comment #1
gordon CreditAttribution: gordon commentedHere is an update to the original patch which brings it upto date.
Comment #2
Tobias Maier CreditAttribution: Tobias Maier commentedI 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
Comment #3
gordon CreditAttribution: gordon commentedI have updated the patch so that the autocomplete checks to make sure the field has autocomplete enabled.
I also fixed up the pgsql update.
Comment #4
Dries CreditAttribution: Dries commented1. 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.
Comment #5
gordon CreditAttribution: gordon commentedThe field for updating the Auto-complete was there. Well it is back now.
Comment #6
Dries CreditAttribution: Dries commentedThe value of the checkbox doesn't get saved (and the textfield is always a regular textfied).
Comment #7
gordon CreditAttribution: gordon commentedThis time, I think it is all back in the patch.
Comment #8
Dries CreditAttribution: Dries commentedWhen I create a field, I get:
Did you test this?
Comment #9
gordon CreditAttribution: gordon commentedI can't believe I missed that. I was testing the updates and not the insert.
Sorry about that.
Comment #10
Dries CreditAttribution: Dries commentedCommitted to HEAD. Thanks. (Still had to fix another bug ...)
Comment #11
(not verified) CreditAttribution: commented