Hi,
I have a table that has a varchar-based primary key, which is a code supplied by the user when creating the record. Autoadmin works, except it doesn't give the user the ability to enter a key field, as the primary_key autoadmin type maps into a Form API 'value' type.
I've crafted a patch that detects non-serial primary keys and presents the user with the appropriate field type for the key type (varchar -> textfield in my case). It should also be overridable with the usual #form key.
I've added test cases (and fixed up the existing test case for the edit form, which didn't write a record before attempting to edit it) and the whole suite passes.
Thanks!
| Comment | File | Size | Author |
|---|---|---|---|
| autoadmin-nonserial.patch | 10.42 KB | neilnz |
Comments
Comment #1
_rune commentedCool! Is on vacation the next two weeks, talk to you after!
Cheers
Rune
Comment #2
_rune commentedHi
Your patch looks grand, and even though non-serial PKs scares me a bit, I will commit the patch soonly with some other changes that I'm working on, namely more flexibility in the list view.
Would you like to have maintainer status of Auto Admin and do it yourself?
Cheers
Rune
Comment #3
_rune commentedAfter thinking a bit more on this I'm getting this sinking feeling inside. What is a good usecase for non-serial primary keys, except working with badly configured database schemas?
Comment #4
_rune commentedDid not hear from you, closing.
Thanks!
Rune