Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If I could use the rules module to "Set a data value" which was a the value of the RealName variable I could assign different RealNames (different token strings) to different kinds of profiles.
This would be a nice feature to have for this module. Does anyone know how to do this?
Comments
Comment #1
Oceanman CreditAttribution: Oceanman commentedI updated the title to better reflect what this feature request is about.
My goal is to set the RealName based on the condition that a user has a certain role or profile2 type.
Using Rules you can set an "Action". It is this action which is not yet integrated into RealName. I would like to "set a data value" and that would be the RealName token string. Rules does not see this token string yet.
The way I understand it, Rules sees entities automatically but modules like RealName need additional integration to define the data types, conditions and actions unique to the module.
As an example, at present you can set the "label" on a profile2 profile using the "set a data value" method within Rules.
I am looking into how to integrate this action and it requires a realname.rule.inc file which contains at least the hook_rules_action_info to define what the action is.
Here is some Rules documentation if you have the skills and can help create a patch for this.
for D7 http://drupal.org/node/878718
http://drupalcontrib.org/api/drupal/contributions!rules!rules.rules.inc/...
Comment #2
Dave ReidThis should be implemented now with #1414140: Add rules integration for RealName
Comment #3
Golem07 CreditAttribution: Golem07 commentedI am sorry for reopening but this issue seems to fit better than creating a new one (hope this is the way to do it). Please correct me if I am wrong.
From the reply I learn that now it is supposed to be possible to set a real name using rules (which is great!). However, the only action connected to realname is the "update" one. I tried setting a data value like the original poster did. But all I seem to be able to change is the actual account name and not the real name. Which action should I use in order to set the realname only and not the original (I am using a simple text field on the user profile which - if not empty - should be used as the realname).
Thanks a lot in advance!