I have a rule with Events:
-After saving a new user account
-After updating an existing user account

In conditions, I try to put "Data value is empty" -> account: (I don't found "picture", "image" or any of this)

I have:
admin/config/people/accounts
user images [check]

Comments

Subhransu.addweb’s picture

Try this rules.

1. Event:-
After saving a new user account.
After updating an existing user account.
2. Conditions:-
Data comparison(image field).

rules name:user image.

{ "rules_user_image" : {
    "LABEL" : "User Image",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules" ],
    "ON" : { "user_insert" : [], "user_update" : [] },
    "IF" : [
      { "data_is" : {
          "data" : [ "site:current-user:field-user-image" ],
          "value" : [ "account:field-user-image" ]
        }
      }
    ],
    "DO" : [ { "drupal_message" : { "message" : "please Enter image in account" } } ]
  }
}

Hope that helps you.

Thanks!

Subhransu.addweb’s picture

Status: Active » Needs review
melonangie’s picture

I dont see "site:current-user:field-user-image"

TR’s picture

Status: Needs review » Fixed

This question was answered in #1. "Needs review" was the wrong status ...

Re #2: You need to enable user pictures at /admin/config/people/accounts in order for the user image field to be available.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

noopal’s picture

I have enabled user pictures at /admin/config/people/accounts. I am trying to check if a user has a picture but the option is not there in rules.

I have the following variables available

account:uid
account:named
account:mail
account:url
account:edit-url
account:last-access
account:last-login
account:created
account:roles

Using latest version of Drupal 7 and Rules.