Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
I tried to proceed with Rules, but I did not succeed:
Event: "after saving new content"
Condition : "Content is a group"
Action1: "Add a new vocabulary"
Action2: "Assign vocabulary to group"
The vocabulary is correctly created, but no way to get it assigned to the group.
I even tried to add a watchdog logging between these 2 actions to improve the chances for a correct scheduling
I would appreciate any help on this.
Thanks in advance
(I changed to "support request" as this seems an old issue not planned to being addressed)
jvielle try this:
Before adding the vocabulary to the group, try adding a new action to load it (i.e. the 'Load a vocabulary' action).
Load the vocab you just created. I entered <?php print $taxonomy_vocab->vid; ?> in the 'Select by vocabulary id' field to accomplish this.
Use this loaded vocabulary for the 'Assign vocabulary to group' action.
Actually, I finally got it.
The problem was that I changed the "Variable taxonomy_vocab settings" default value "taxonomy_vocab" and "Variable taxonomy term settings" default value "taxonomy term" - the labels seems to be of importance though they appear to be modifiable.
Also, the label does not increment automatically, so creating multiple terms needs to change the label "taxonomy term" to "taxonomy term1", "taxonomy term2"....
So the rule is not to change the propose label, just add a numerical increment for each occurrence of the same action.
I would suggest to handle this label automatically instead of letting the user define a label which is not understood by the program. If it is too hard, just let the user assign a unique integer
Comments
Comment #1
giorgio79 commentedPerhaps exposing a rule for "After creation of og" would be a good way but then this request should go under og :)
Let me know what you think.
Comment #2
amitaibuYou can already use Rules module to do it - og_vocab has rules integration.
Comment #4
jvieille commentedI tried to proceed with Rules, but I did not succeed:
Event: "after saving new content"
Condition : "Content is a group"
Action1: "Add a new vocabulary"
Action2: "Assign vocabulary to group"
The vocabulary is correctly created, but no way to get it assigned to the group.
I even tried to add a watchdog logging between these 2 actions to improve the chances for a correct scheduling
I would appreciate any help on this.
Thanks in advance
(I changed to "support request" as this seems an old issue not planned to being addressed)
Comment #5
jacoblane commentedjvielle try this:
Before adding the vocabulary to the group, try adding a new action to load it (i.e. the 'Load a vocabulary' action).
Load the vocab you just created. I entered
<?php print $taxonomy_vocab->vid; ?>in the 'Select by vocabulary id' field to accomplish this.Use this loaded vocabulary for the 'Assign vocabulary to group' action.
Comment #6
jvieille commentedActually, I finally got it.
The problem was that I changed the "Variable taxonomy_vocab settings" default value "taxonomy_vocab" and "Variable taxonomy term settings" default value "taxonomy term" - the labels seems to be of importance though they appear to be modifiable.
Also, the label does not increment automatically, so creating multiple terms needs to change the label "taxonomy term" to "taxonomy term1", "taxonomy term2"....
So the rule is not to change the propose label, just add a numerical increment for each occurrence of the same action.
I would suggest to handle this label automatically instead of letting the user define a label which is not understood by the program. If it is too hard, just let the user assign a unique integer
Comment #7
joshmccormack commentedHow would I make just 1 vocabulary created for each user and have it used for all groups made by the user (and only usable by that user)?