Event
before create new user account

condition
User created by uLogin

action
set a data value..

but in action, i can't found any field related to ulogin!

Comments

duozersk’s picture

Assigned: Unassigned » duozersk

Alex,

uLogin provides user tokens, not fields. Please see #1472704: Use token to prepopulate profile fields for guidance. It is a bit outdated as now we have the "User created by uLogin" condition, but you should get the idea.

Thanks
AndyB

dgastudio’s picture

yes, i have read #1472704: Use token to prepopulate profile fields.

but as i say, i can't found any reference to ulogin.

The new value to set for the specified data.
in direct input mode, i only have found: [account:ulogin], nothing more (age, name, surname, etc)

in data select mode, there are no any reference to ulogin.

of course, i always can use php validator, but..

thank you.

duozersk’s picture

Well... just use it ([account:ulogin:first_name], etc.), there are some glitches in the token browser so it doesn't show the deeper level. To get the key names see any user created by uLogin -> uLogin identitites tab - there you should see a table of available tokens (if you have "administer users" permission).

AndyB

duozersk’s picture

Status: Active » Closed (works as designed)

Closing this one. Please reopen if anything else is needed here.

AndyB

dgastudio’s picture

Status: Closed (works as designed) » Active

sorry, but no.

my rule

{ "rules_ulogin_prepopulate" : {
    "LABEL" : "ulogin_prepopulate",
    "PLUGIN" : "reaction rule",
    "REQUIRES" : [ "ulogin", "rules" ],
    "ON" : [ "user_presave", "user_update" ],
    "IF" : [ { "ulogin_user_created_ulogin" : { "account" : [ "account" ] } } ],
    "DO" : [
      { "data_set" : {
          "data" : [ "account:field-user-name-surname" ],
          "value" : "[user:ulogin:last_name] [user:ulogin:first_name]"
        }
      },
      { "data_set" : {
          "data" : [ "account:field-user-gender:name" ],
          "value" : "[user:ulogin:sex]"
        }
      },
      { "data_set" : { "data" : [ "account:field-user-birthday" ], "value" : [ "" ] } }
    ]
  }
}

and my user_load array after SAVE ACCOUNT:

stdClass Object
(
    [uid] => 9
    [name] => ulogin_google_106030771695231444354
    [pass] => ***
    [mail] => ***
    [theme] => 
    [signature] => 
    [signature_format] => full_html
    [created] => 1340090834
    [access] => 1340090834
    [login] => 1340090834
    [status] => 1
    [timezone] => 
    [language] => 
    [picture] => 
    [init] => ulogin_google_106030771695231444354
    [data] => Array
        (
            [ulogin] => Array
                (
                    [network] => google
                    [identity] => https://plus.google.com/u/0/106030771695231444354/
                    [uid] => 106030771695231444354
                    [email] => dgastudio@gmail.com
                    [nickname] => Alexei
                    [first_name] => Alexei
                    [last_name] => Eshchenko
                    [bdate] => 28.06.1981
                    [sex] => 2
                    [photo] => http://www.google.com/ig/c/photos/public/AIbEiAIAAABDCILLgL743ObYUyILdmNhcmRfcGhvdG8qKDBiN2Y2YTVhMjAwMTlkNWUyZTk0MmRhZmJmYTg1YjFjNDQzNmVmYmEwAQocN51cNvu_uF04Z1gy0IDqXLOw
                    [photo_big] => http://ulogin.ru/img/photo_big.png
                    [city] => 
                    [country] => Белоруссия
                    [manual] => bdate,sex
                )

        )

    [roles] => Array
        (
            [2] => authenticated user
        )

    [field_user_name_surname] => Array
        (
            [und] => Array
                (
                    [0] => Array
                        (
                            [value] => [user:ulogin:last_name] [user:ulogin:first_name]
                            [format] => 
                            [safe_value] => [user:ulogin:last_name] [user:ulogin:first_name]
                        )

                )

        )

    [field_user_about] => Array
        (
        )

    [field_user_practice] => Array
        (
        )

    [field_user_phone] => Array
        (
        )

    [field_user_url] => Array
        (
        )

    [field_user_gender] => Array
        (
        )

    [field_user_birthday] => Array
        (
            [und] => Array
                (
                    [0] => Array
                        (
                            [value] => 
                            [timezone] => Europe/Moscow
                            [timezone_db] => Europe/Moscow
                            [date_type] => datetime
                        )

                )

        )

    [entity_view_prepared] => 1

as you can see, empty tokens are stored as field_user_name_surname value.

duozersk’s picture

Just tested this rule - it works:

{ "rules_change_user_info" : {
    "LABEL" : "Change user info",
    "PLUGIN" : "reaction rule",
    "REQUIRES" : [ "ulogin", "rules" ],
    "ON" : [ "user_presave" ],
    "IF" : [ { "ulogin_user_created_ulogin" : { "account" : [ "account" ] } } ],
    "DO" : [
      { "data_set" : {
          "data" : [ "account:field-user-name-surname" ],
          "value" : "[account:ulogin:first_name] [account:ulogin:last_name]"
        }
      }
    ]
  }
}

Can you import it and see if it works on your site? If yes then you can start adding more events and actions...

Side note: with this rule set to act on "user_presave" event the user won't be able to edit the set field - it will always be overwritten by this rule. If this is the desired behavior - then all is fine.

Thanks
AndyB

duozersk’s picture

Status: Active » Closed (works as designed)

OK, since no feedback - closing it once again. Please reopen if needed.

roma4ke’s picture

Status: Closed (works as designed) » Active

Help please , trying to load Photo to Profile2 image field. Don't have account: ulogin

roma4ke’s picture

How to load image from uLogin to profile2 image field ?

chimir’s picture

Version: 7.x-1.x-dev » 7.x-1.10
Issue summary: View changes

Подскажите, как заполнить поля созданные с помощью field collection

Приведенный выше правило, работает, если поле создано в профиле пользователя, но если поле создано в field collection, то оно не заполняется скриншот

duozersk’s picture

Version: 7.x-1.10 » 7.x-1.x-dev
Status: Active » Closed (works as designed)

chimir,

С field collection-ами есть всякие сложности при работе с ними через рулзы, точно не для этого модуля (ulogin) задачка.

И завязывайте постить в закрытые и решённые вопросы со своими ишьюсами - заводите новые.

AndyB

chimir’s picture

Спасибо за ответ

И завязывайте постить в закрытые и решённые вопросы со своими ишьюсами - заводите новые.

извиняюсь, думал наоборот, не стоит плодить новые вопросы, буду знать