I need to show a message when user needs to fill his content profile.
So I create a rule that shows a message on every pages (User is going to view a page).
In some case, the message appears two times or more.
Is there a variable that show il a rule has already been call ?
Attention, votre profil n'est pas rempli, vous devez le compléter en cliquant sur ce lien.
0 ms "User is going to view a page" has been invoked.
5.515 ms Executing the rule "Compléter son profil, à chaque page" on rule set "User is going to view a page"
8.003 ms Loaded variable "acting user"
8.594 ms Condition "Le Profil de acting user a été créé" evaluated to FALSE.
8.712 ms Condition "User has role(s)" evaluated to TRUE.
17.188 ms Action execution: "Show a configurable message on the site"
17.271 ms Evaluation of "User is going to view a page" has been finished.
0 ms "After updating existing content" has been invoked.
0.085 ms Executing the rule "Mail : Animation dans 10 jours" on rule set "After updating existing content"
0.237 ms Condition "Contenu mis à jour est Actualité" evaluated to TRUE.
1.193 ms Condition "Comparaison numérique" evaluated to FALSE.
1.257 ms Executing the rule "Workflow : si modification -> à vérifier" on rule set "After updating existing content"
2.807 ms Loaded variable "acting user"
2.876 ms Condition "User has role(s)" evaluated to TRUE.
2.999 ms Action execution: "Change workflow state of contenu to new state"
3.227 ms Evaluation of "After updating existing content" has been finished.
Le contenu 'Test workflow', de type 'Actualité', a été mis à jour.
Attention, votre profil n'est pas rempli, vous devez le compléter en cliquant sur ce lien.
0 ms "User is going to view a page" has been invoked.
5.425 ms Executing the rule "Compléter son profil, à chaque page" on rule set "User is going to view a page"
7.904 ms Loaded variable "acting user"
8.495 ms Condition "Le Profil de acting user a été créé" evaluated to FALSE.
8.613 ms Condition "User has role(s)" evaluated to TRUE.
17.106 ms Action execution: "Show a configurable message on the site"
17.208 ms Evaluation of "User is going to view a page" has been finished.
0 ms "Le contenu est sur le point d'être consulté" has been invoked.
0.079 ms Executing the rule "Renvoyer Content Profil au Profil" on rule set "Le contenu est sur le point d'être consulté"
0.23 ms Condition "Contenu consulté est Profil" evaluated to FALSE.
0.277 ms Evaluation of "Le contenu est sur le point d'être consulté" has been finished.
Comments
Comment #1
gilles_c commentedIt seems that this module works : Better Message Action for Rules
I put the repeat function of the message to false.
Comment #2
fagoIf the vent is invoked twice, the action will be executed twice.
Comment #3
smaier commentedSorry to have to re-open this, but it is causing an issue for one of my sites.
I believe I have found a simple fix for this. In "rules\rules\modules\system.rules.inc" on line 78 change:
drupal_set_message($settings['message'], $settings['error'] ? 'error' : 'status');to this:
drupal_set_message($settings['message'], $settings['error'] ? 'error' : 'status', FALSE);Could probably put a toggle on the Settings page to enable/disable of showing repeating messages. Found this post that inspired this fix: http://drupal.org/node/536826
Comment #4
chinita7 commented@smaier Thanks it works.
Comment #5
tr commentedD6 Rules is unsupported and the repeat parameter can be set when configuring the action in D7 and D8 Rules, so there is nothing here to fix anymore.