This is a fantastic module and has a lot of potential to be really powerful! I have already been playing around with it to see what it can do and I like it.
There is one thing I would like, and also think might be beneficial if in the scope of the module. I would like to save the created terms (and terms if they already exist) to nodes. This might be pretty easy if taxonomy_builder_save_terms($vid, $hierarchy) returned an array of term IDs. From what I have gotten to work, only the term ID of the last term in the array of terms is returned. Would it be possible to return an array of tids? Or better yet have a function that would automatically save the tids with a specific nid??
Comments
Comment #1
cpliakas commentedHi mkinnan.
I really like the idea of returning an array of IDs instead of just the last one added, and I think it is a feature missing from the API. In terms of saving nodes, you can actually probably already do this in hook_taxonomy_builder_term_save(). This will give you access to the newly created tid and the given level it was added to. However, this hook is only invoked when a new term is added to the hierarchy, which may or may not be what you are looking for. Hope this helps, and I will think more about the array of ID.
Thanks a lot for posting,
Chris
Comment #2
mkinnan commentedThanks Chris for thinking about this option. I know this is crude, but this is the hack I did to get the term IDs of the array.
Comment #3
mkinnan commentedAdditionally, I want to be able to return the term ID whether the term exists or not so that I can save it to the node. Since hook_taxonomy_builder_term_save() is only called on new terms, it won't work in my case.
Comment #4
cpliakas commentedClosed due to end of life announcement.