Closed (fixed)
Project:
Term Fields
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
27 May 2010 at 15:21 UTC
Updated:
2 Nov 2011 at 19:10 UTC
Ok, unless I'm missing something basic, the primary key for {term_fields} is wrong.
term_fields_schema() says the primary key is term_fields.fid, but that means that fid "xyzzy" can only appear in one vocab.
It seems to me that the correct primary key is (vid, fid).
Patch for an update function attached.
| Comment | File | Size | Author |
|---|---|---|---|
| term_fields_primary_key.patch | 653 bytes | dotton |
Comments
Comment #1
b-prod commentedActually a fid can only appear for one vocabulary.
Modifying schema to have (vid, fid) as PK means changes in the module code.
Feel free to work on this feature, I would put it in the core if it take care of the current code in module.
Thanks for your interest.
Comment #2
dotton commentedYeah, I see it now. You've got the field type bound up with the field name, so you can't have, say, a field 'blah' which is an int for $vid 1, and a longtext for $vid 2. It wasn't biting me 'cos my fields are all longtext.
First step would be to smooth out the db. I'm working round the problem right now by writing my own CRUD functions, but I'll think on the database issue, see if I can come up with a better schema.
Comment #3
b-prod commentedEach field can now be used in all vocabularies.