Add option to change vocabulary

catch - October 27, 2009 - 02:58
Project:Edit term
Version:6.x-1.3
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work
Description

Needed this for one of my own sites. Patch currently only changes $form['vid'] to a select, to be committable it probably needs to:

1. Be in advanced options

2. Be a setting somewhere?

3. Validate if the term has parents or related terms and prevent changing vocabulary in those cases.

However I don't have time to add that stuff this morning. If you'd consider accepting a patch which does some of this, I might be persuaded to fix later though.

AttachmentSize
vocabulary.patch1.15 KB

#1

agaric - October 27, 2009 - 03:09

First instinct is let's do it, and should this ability be in core?

Second thought is that Edit Term has been about making it easy to get to the edit screen, and was not going to be ported to 7 as that's now in core.

The old taxonomy_switch module, which i sort of helped upgrade to 5, is where this functionality used to live, and according to this issue Taxonomy Manager can get the job done in 6.

If catch's is the best implementation i can still see edit term ending up the home for this functionality, which i agree is awesome to have, and a real benefit of Drupal's taxonomy structure that should be made possible to actually use.

#2

catch - October 27, 2009 - 03:23

bangpound pointed out to me in irc when I suggested a core issue, that field API makes this impossible to do safely in core, since we then have all the problems of switching content types, which is right, even if it's a shame. It's possibe if we added this with validation, we could also diff the bundles attached to the two vocabularies before allowing a switch in D6 (and whether they have any content in?) not sure about that though. I haven't used taxonomy_manager since Drupal 5, since edit_term lets me do everything I'd want most of the time.

edit: so my thought on this would be adding it here in D6, then possibly porting taxonomy_switch to Drupal 7 if edit_term goes into retirement :)

#3

dman - October 27, 2009 - 03:36

Edit term includes those additions to the term edit page like menu and alias support, so this advanced features fits logically enough.

But yeah, the possibility of some pretty odd damage is there if used wrongly. Did taxonomy_switch encounter any of that?
I'm trying to imagine the issues, and they are each hairy - and would involve a lot of overhead to validate correctly - more actual exception handling code than useful change code. Which is often a warning sign with architecture.

So our issues include:
- What if the destination vocab does not apply to the same node type? What happens to the previous taggings? (Deletion means lost data, prevention is frustration, automation of some sort of fix is hard)
- What if the term is part of a heirarchy? What about its children? (I'd imagine children should go too, but that's lots of work)
- What about related terms? (I never noticed that related terms were limited to the same vocab - I'm wondering if that is actually neccessary or useful)
- Would we need a new permission for this? Because it's possible to F* things up pretty badly, and normally I'd expect to be able to give content editors edit_term permissions. But not this.

:-(

 
 

Drupal is a registered trademark of Dries Buytaert.