'Associate a Taxonomy term to user who creates it

I have field Company Name which is a term reference to a vocabulary with same name. when user types the field if name already exists, so auto complete showed that or else it will be added as taxonomy term. let us consider "BBB" is the company name he entered.

On next scenario when another user keying in this company name as "BBB" so its already their in the taxonomy so i have to send a mail to the user who created added the term "BBB" first.

I tried using rules module but i couldn't find way to get the user who created the term.Meanwhile i use Profile2 module so writing submit handler is best?



Solution 1:[1]

You can add a user reference field to the taxonomy entity so it will have a Name, Description and that User reference field.

Then you have to run a Rule on events "taxonomy_term_update" and "taxonomy_term_insert" that will save the user id on that field. See the rules code example on a Drupal.org related issue.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 TheodorosPloumis