Before I learned to go "all the way" with content taxonomy module, I was constantly frustrated by the way the module would remove the vocabularies from my node forms. If you don't set up all a node type's taxonomy vocabularies as content taxonomy fields, you can inadvertently lose data when you load existing nodes and save them again. I completely understand why this happens now (and why it has to happen), but I wonder if there are ways to change this unforgiving behavior of Content Taxonomy module.
The hook_term_path is the only apparent use of the module property on vocabulary objects in core. But why stop there?
If the module could "claim" those vocabularies used in content_taxonomy fields, I think the module could be a little more forgiving. In content_taxonomy_form_alter, only those vocabularies whose module property is 'content_taxonomy' should be unset. Other vocabularies can remain visible.
If people think this is an acceptable idea, an upgrade path would require an update function to check all CCK fields for those whose module is content_taxonomy. The vocabulary table would be updated with the new module info using these field objects' vid properties.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | content_taxonomy-claims-vocabularies.patch | 3.32 KB | Anonymous (not verified) |
Comments
Comment #1
Anonymous (not verified) commentedI can see how this might be a problem if someone uses content taxonomy fields on a vocabulary that's already owned by another module, so this patch avoids that possibility by simply disallowing it. If we can avoid nuking taxonomy selections on node forms, there may be some sense in preventing content_taxonomy fields from using those vocabularies that belong to other modules. Other people may have differing opinions or experience.
Here's a patch that does what I propose:
Please have a look when you have time. This kind of delicate dealing with node term relationships will make this module a lot easier for people to use well!
I'm making this proposal because of specific interactions between Calais module and Content Taxonomy module. Calais may manage 20+ vocabularies. Dozens of terms might be selected in each one. They all might apply to many content types. The only way to use these two modules together is to create fields for each vocabulary created by Calais, some of which are created on the fly!
Comment #2
mh86 commentedHi!
I like the idea. When I initially started with the Content Taxonomy, I was planing to implement something like this, but the code to do that got complicated and I decided to go the easy way.
The patch looks good. At the moment I don't have much time and there are some other critical issues, but I'm definitely going to review the patch in more detail and commit it.
Comment #3
Anonymous (not verified) commentedI think there are still some issues to work out in the patch, so please let me work on it some more and I'll resubmit. I don't want to waste your time with a half-baked patch! Thanks.
Comment #4
Anonymous (not verified) commentedI'm closing this issue. Please see #319724: only unset taxonomy form elements that would conflict with content_taxonomy fields for a new patch using a different method. This method was short sighted and disallowed the possibility that we'd want to use hook_term_path on content_taxonomy field vocabularies.
Comment #5
Anonymous (not verified) commented