How to resolve the error encountered while trying to import a rule using the Rules module? I have created a rule by using php code,i want to import it.When i click on import button it is showing that import block border as red(shown in the fig..)


Image





Code


And my code is shown in below,

{ "rules_send_warning_email" : {
    "LABEL" : "Send Warning Email",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules" ],
    "ON" : { "user_update" : [] },
    "IF" : [
      { "text_matches" : { "text" : [ "site:current-user:field-warnings" ], "match" : "New litter" } }
    ],
    "DO" : [
      { "mail" : {
          "to" : "[site:mail]",
          "subject" : "New litter was born",
          "message" : "[site:current-user] selected new litter",
          "language" : [ "" ]
        }
      }
    ]
  }
}
Your rule is looking for a field on the user entity type called "field_warnings". That field doesn't exist, or can't be found for whatever reason, so the import will fail.

You need to either add the field, or find out why Drupal can't find it, to continue with the import.