I have a case where I want to clear all terms from new content for a give vocabulary and assign a default term.

Currently I have to load all the terms, delete the ones I don't want from the content and assign the term I do want. This means my triggers action loads five terms, deletes four terms and assigns one term.

The patch adds a option to delete all vocabulary terms from the content. This means that trigger action now removes vocabulary, loads term, assigns term. Three steps are much simpler than ten.

Please go easy on me as this is my first attempt at adding code to rules and the code might needs some tweaking, clean up, etc.

Thoughts?

CommentFileSizeAuthor
rules_remove_vocabulary.diff1.65 KBhawk259

Comments

fago’s picture

Status: Active » Needs work

that makes sense. However make sure your patch is compliant to the drupal coding standards.

In-code (one line) comments are usually written with //
also have a look at your indention.

Why does the action provide a new vocabulary, shouldn't it require one as argument?!

then pleases have a look at this related issue: http://drupal.org/node/350831
Best build upon it and reuse the data type there.

hawk259’s picture

It seems $node->taxonomy bounces around with the format:

http://drupal.org/node/379564

I will follow up with a new patch once I work out the details of the above bug.

mitchell’s picture

Status: Needs work » Closed (duplicate)
mitchell’s picture

Component: Provided module integration » Provided Module Integrations

Updated component.