Closed (works as designed)
Project:
Features
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
16 Jul 2009 at 20:01 UTC
Updated:
4 Sep 2011 at 04:51 UTC
Jump to comment: Most recent
Comments
Comment #1
redpuma commentedmy first feature is 80% ok, but I guess taxonomy is not exported yet? Will taxonomy be part of this in later releases as my node type uses taxonomy in combination with a view which filters by term.
Comment #2
joachim commentedHere's some code that may be useful for creating taxonomies:
I've used this in hook_install to put default taxos with a module.
Comment #3
Anonymous (not verified) commentedsubscribing
Comment #4
EvanDonovan commentedsubscribing...
Comment #5
jazzslider commentedI'd like to help with this if I can, since most of the stuff I want to export as features is heavily dependent on the presence of certain vocabularies. As I understand it, these are the pieces that have yet to be figured out:
Thinking through all this brings a few questions to mind. It seems like there are three possible places where some or all of these patches could be applied:
I kind of dislike the idea of using a helper module just for features integration…seems like it should be handled either inside the module providing the component, or in the features module itself (as with node, views, etc.).
Anyway, that's my brain dump on that for the moment…I would love to be a part of this conversation, and hopefully contribute some working code before too long…but feedback at this point is critical, since there seem to be too many ways of doing this :)
Let me know what you think!
Thanks,
Adam
Comment #6
EvanDonovan commented@jazzslider: I think that using a helper module is the "Drupal way" - keep everything as modular as possible. I wish you great success with this; I think it could be helpful to many people.
D6 is feature-frozen even for API functions; you can try to get them in D7, but it might be too late even for that. Worth a shot, though. D7 has a different DB abstraction layer, so you'd have to bear that in mind.
Comment #7
jazzslider commentedThanks for getting back to me about that; I'm curious, though, as to why the features module hasn't taken the "helper module" approach with the exportables it already implements…e.g., if you look in the includes directory, there are several files adding functionality on behalf of various other modules: content, menu, node, views, etc. (These files even go so far as to add functions in other modules' namespaces: views_* and so on.)
I'm not sure this is really the ideal approach, although it's certainly the simplest. Ideally, modules would all provide their own features hooks (e.g., views_features_api() would live in views, not features), right?
With contributed modules, this ideal is a very real possibility, provided that module maintainers are willing to take the time to review the necessary patches. With core modules, it's pretty much impossible at this point, at least for D6 and D7.
That leaves us with two possibilities: add more components in features/includes, or add helper modules that provide the necessary features hooks in the same way that features/includes files do. My first instinct, since features/includes already exists, is to take care of it there rather than adding another helper module dependency.
The problem, of course, is that taxonomy requires a bit more work than those other modules do, on account of the fact that vocabularies lack machine-readable names. The exportables module provides one possible solution to this, but using a helper module for one kind of component and not using one for the others seems like it would produce a bit of unnecessary unpredictability.
On the other hand, the taxonomy_export module does provide a useful service even without features: it makes it possible to export vocabulary as code for use in install profiles. So it wouldn't necessarily be a great idea to collapse that code into features, because then it couldn't be reused without features.
Eh, it's a rock and a hard place, isn't it? It would all be so much easier if we could just add a couple of new functions to taxonomy.module :)
I'm going to continue looking into this as I get the opportunity; one way or another, I really want to be able to leverage vocabularies in my exported features…they're an extremely important part of how I tend to do my Drupal site building.
Comment #8
jazzslider commentedHello!
For the time being, I've gone ahead and uploaded a first-draft patch to the exportables module, which you can find at http://drupal.org/node/544204#comment-2099430 . It has some issues, which are documented there…and it might fit better somewhere else, I dunno. In any case, if you're interested, take a look!
Thanks,
Adam
Comment #9
jazzslider commentedHello!
Spent a lot more time looking into this this week, posting issues all over D.o, sometimes intelligently and sometimes not :) Here's the state of features' taxonomy integration as I see it:
This is mainly just a summary post so that interested parties can see all this activity in the one place they're most likely to look for it …seems sort of difficult to keep the conversation connected when the work and discussion is occurring across several different Drupal components :)
In any case, please provide any feedback you may have …as I've said before, I've got the time and the motivation to do what it takes to get this working, but I want to make sure I don't make any dumb mistakes along the way that could've been avoided with a little communication :)
Thanks!
Adam
Comment #10
mani.atico commentedsubscribe
Comment #11
merilainen commentedsubscribing
Comment #12
Anonymous (not verified) commentedI need to be on this issue. I've been working on my own solution already... thankfully I can stop and collaborate instead.
Comment #13
chachasikes commentedi'm interested in this too
Comment #14
jazzslider commentedHello!
For what it's worth, I've been actively working on adding this functionality in the existing exportables module; the patch I referenced earlier (in #544204: Integration with features module?) is already committed to CVS and seems to be working correctly. There are a few issues left to resolve (most notably #598510: exportables_sync() should be tied to enabling/disabling the module providing the default items) before I'd say it's production-ready, but it's definitely a good start.
Ultimately I'd love to see this as a native part of the features module, but unless we can get machine-readable vocabulary names into the Drupal 6 core (they're already available in D7), I don't know that that's likely. There's always going to have to be an extra layer providing the machine names, and exportables is currently our best shot at that.
Please feel free to give it a whirl; it's still very much a development release, but the more eyes we have on it, the better chance we have of getting it stable :)
Thanks!
Adam
Comment #15
pvhee commentedsubscribing
Comment #16
dsnopekI can see the code in the "exportables" module for providing "features" integration, however -- How is this planned to actually integrate?
Would it be with "features" having an optional dependency on "exportables" and a new include/features.taxonomy.inc file that implements taxonomy_features_export(), taxonomy_features_export_options(), taxonomy_features_export_render(), etc.. ??
If I knew how to connect the dots from "exportables" to "features" I'd be happy to test integration and maybe hack on it a little bit, but I'm not sure where to start. Please advise.
Thank you!
Comment #17
dsnopekNever mind my questions! I didn't notice that modules/taxonomy.inc implemented the features hooks.
All I had to do was add a machine readable name to my vocabulary, which I did directly in the database:
Then add info about it in my features *.info file:
And update the feature with drush:
Everything appears to be in working order. I'm not (yet) including any views or anything that uses this vocabulary, just using it on the content type I'm including.
I really need to get the terms on the vocabulary too, but I'm not sure that is in the scope of the exportables module? I may hack it on there.
Comment #18
dsnopekFYI, I created a patch to "exportables" that will causes all of a taxonomy's terms to also be exported and included in a feature. You can find it here: #645596: Patch to export taxonomy terms
Comment #19
dsnopekThis issue is also now at play for further taxonomy support: #651084: Patch for special treatment of install hooks -- required for taxonomy integration
Comment #20
todd nienkerk commentedSubscribing.
Comment #21
m_z commentedSubscribing.
Comment #22
q0rban commentedsubscribing..
Comment #23
mrfelton commentedSubscribing... Is there a reccommended approach to exporting/importing taxonomy and taxonomy terms with Features? Is it to use the exportables module?
What happens if a feature is being developed offline, and it includes a view that references a taxonomy (both the view and the taxonomy are included in the feature). But, presumably the reference on views part will still be referenceing the taxonomy by it's numeric id? So, if you import this feature onto the live site, the taxonomy may be created, the view may be created, but the two might not link together correctly due to the taxonomy having a new numeric ID on the live site?
Comment #24
m_z commentedIt seems that there are many people interested in a "best practice" for a connection between Taxonomy and Features.
I decided to test Exportables module which works okay, but there are still some open issues http://drupal.org/node/645596.
And the problem which is described in #23 is not unknown (e.g. see http://drupal.org/node/645596#comment-2593388), but I don't know if there already exists a solution.
What about putting all our knowledge about Taxonomy integration into Features on a "comparison page" where we compare all approaches with pros and cons?
Comment #25
jonskulski commentedThe issue with exportables and taxonomy export is exactly what mrfenton in #23 has said, any newly imported taxonomy will have a new ID and anything built with the taxonomy (views, etc) won't know about it.
Exportables solution has been to map id -> machine name in their own table. This is an OK solution, however I could see there being issues with it. The problem is that then the view's code needs to know about this conversion. Which it doesn't and the problem isn't solved.
My solution has been to reserve IDs for the taxonomy and vocabulary terms i know I am going to use and bump up the auto increment number by 10,000. I have a module built on features and exportables that does this. It's almost ready to be released and will update the thread when it is.
Comment #26
qbnflaco commentedI myself am going to try out using the deploy module with features. I don't have any views or context that depend on a hard coded term id, so I think that issue won't affect me. Deploy assigns a unique number to everything so that you can continue to sync updates. Maybe having some integration with UUID to place and replace those when moving over the the new site?
Comment #27
detot commentedSubscribing.
Comment #28
Anonymous (not verified) commentedsubscribing
Comment #29
maomaohuhu commentedsubscribing
Comment #30
cyberwolf commentedSubscribing.
Comment #31
mikeytown2 commentedsubscribing
Comment #32
alex_b commentedMaybe of interest: I just posted #789556: Support taxonomy vocabularies which focuses on a vocabulary-only export.
Comment #33
thebuckst0p commentedSubscribe
Comment #34
chriscalip commentedsubscribe
note to self: dev->staging->production
-- good starting page on exporting taxonomy terms and also see community effort to bring taxonomy terms into features -- no stable solution yet.
Comment #35
greg.harveyBeginnings of Features support here, according to the project page:
http://drupal.org/node/698006
Comment #36
mrfelton commentedAlso, http://drupal.org/project/features_extra provides features support for taxonomy (and other things)
Comment #37
mparker17Subscribe
Comment #38
jmseigneur commentedIn addition to http://drupal.org/project/features_extra , http://drupal.org/project/taxonomy_export 2.x has an experimental integration with Features.
However, http://drupal.org/project/features_extra says that "It has views support" but at the moment I have not tried it and I can't find how to "edit the vocabulary, give it a "machine name"," as mentioned on http://drupal.org/project/features_extra
Comment #39
jmseigneur commentedTo give a machine name, you just have to edit the vocabulary as mentioned on http://drupal.org/project/features_extra
The export and import of the vocabularies have worked with http://drupal.org/project/features_extra However, unfortunately it didn't create the terms inside each vocabulary
Comment #40
mrfelton commentedIt says on the module page that it won't create the terms inside the vocab. To be honest, I think that is the correct behavior anyway. Aren't taxonomy terms content? You don't create all the nodes of a certain nodetype when importing/exporting content types.
Comment #41
greg.harveyProblem is technically you're right, but often terms are used for structure (think of modules like Taxonomy Menu and I have many clients with pre-defined vocabularies that are not intended to be altered frequently). In fact, terms are more frequently structural than not, in my experience. Though I see what you're saying...
Comment #42
mrfelton commented@greg.harvey - I actually agree with you, I was just playing the devil. I would definitely be in favor of the ability to bundle terms up with a feature, just as I would be over the moon wiht the ability to bundle nodes up with them too! I often use taxonomy terms for structural purposes, though possibly not the majority of the time.
Comment #43
jp.stacey commentedCan someone confirm the status of this issue relative to #789556: Support taxonomy vocabularies? It's not quite a duplicate.
Comment #44
jmseigneur commentedIt seems to me that #789556: Support taxonomy vocabularies seems quite related to this issue.
Comment #45
jmiccolis commentedHi folks, I've just committed the patch from #789556 and it's as far as I want Features to go into taxonomy territory. I think all the issues have been pretty well discussed above. Let's leave other modules to attempt exporting terms themselves.
Comment #46
alexiswatson commentedIs there a centralized effort to handle exporting terms that's compatible with this new solution, then? I do understand the justification, but before I start off developing my own module to do this, I want to make sure I'm collaborating rather than duplicating.
I assume it would also have to handle machine-names for terms somehow, am I correct?
Comment #47
mikeytown2 commentedI've been working on a shared taxonomy module. It works if your databases can talk to each other via array notion for db_url
http://drupal.org/node/18429
Requires a patch for 6.x; 7.x code is in place so no patch will be needed.
Comment #48
James Andres commentedHi! I'm the maintainer of taxonomy_export. I appreciate the interest, but am too busy to get much of this coding done myself. If anyone is interested in getting becoming a maintainer to help clean up the features integration in the 2.x branch, please let me know over here #521706: Taxonomy export features integration.
All the best,
James
Comment #49
davepoon commentedSubscribe
Comment #50
paolodoors commentedSubscribe
Comment #51
alberto56 commentedSubscribing. Here's a link to the UUID project.
Comment #52
chaps2 commentedAnother way to do this is with the UUID Features Integration module. I've posted a couple of patches (#965450: Add component that exports vocabulary with all its terms and #966510: Add support for related terms and synonyms) which when both applied allow you to import/export whole sets of vocabularies with all hierarchy and relationships intact.
Comment #53
dgtlmoon commentedsubscribe