The autocomplete seems not to work...
It does know the difference between new ones and already existing ones as he adds the new ones, but the list doesn't come up while typing...
Also, when viewing the node after saving, the selected values are not shown either...
I didn't install the patch...
But I altered your code, removed the usage of content_taxonomy_save_tids() and used this to add the terms to the node
function content_taxonomy_save(&$node,$tids){
foreach ($tids as $id => $tid) {
$term = taxonomy_get_term($tid);
$node->taxonomy[$term->vid][] = $tid;
}
}
Could this have caused the problem I'm experiencing?
My code seems to work perfectly on the default taxonomy.module
I was waiting for a CCK taxonomy field for long time, so thanx for all the good work.
I created content types with up to 5 different taxonomy fields and they all work nice...
But they all were select types (both single and multi)
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | content_taxonomy_autocomplete.module.patch.txt | 1.09 KB | ednique |
Comments
Comment #1
mh86 commentedThanks a lot for this post!! I was thinking about the saving-topic really a long time and this could really be a great solution to it. I still have to do some testing, but it seems to work, then I'll committ it as soon as possible!
Comment #2
ednique commentedI did come across an issue.
When a cck type doesn't have a "normal" category attached to it and you re-edit it, there seems to be a problem when you save as the $node->taxonomy is build different: they contain objects in the array and the key is tid instead of vid...
But as my content types all have at least 1 'normal' category this is no prob for me...
Not having a 'normal' category also troubles the pathauto for generating the path from taxonomy.
Finally my main problem is the autocomplete...
If you have any idea, please share...
Comment #3
ednique commentedOk the autocomplete was working, yet the display still remained a problem...
Attached you find a patch to make the autocomplete work (seems like you forgot some piece of code here)
+ the required parameter was not working
Comment #4
ednique commentedstatus change
Comment #5
mh86 commentedyes, you are right, there was something missing! thanks for your patch, I committed it right ahead.
additional I did some changes to the saving procedure, like you proposed, but with some small changes, that allows to update/delete terms. It doesn't affect the content_taxonomy, whether you attach a real category or not. The only problem will occure, when you have a form field from taxonomy module and once from content_taxonomy with the same vocabulary, then terms from the taxonomy module will be ignored.
concerning the display, still I can't find the problem. Are all terms form the autocomplete loaded to the node->field['field_name'] and $node->taxonomy array loaded and if you edit the node, are the terms correctly loaded to the field?
Comment #6
ednique commentedafter my patch the showing was correct again...
So all is good here...
and as for me this issue can be closed.
Why would anyone have both taxonomy form and content taxonomy form with same vocabulary?
I thought about that too, but that's impossible to handle in the code...
As you never know the difference where the data comes from ones the data is saved...
I would just put a sidenote that that isn't possible...
Now I use the normal tax form for navigation categories and the Content tax form for any additional tagging... This works perfect... thanx again for the module...
Comment #7
mh86 commentedComment #8
(not verified) commented