my rules export:

{ "rules_create_institution_for_medics" : {
    "LABEL" : "Create institution for medics",
    "PLUGIN" : "reaction rule",
    "REQUIRES" : [ "rules", "profile2" ],
    "ON" : [ "profile2_presave" ],
    "IF" : [
      { "NOT data_is_empty" : { "data" : [ "profile2:user:profile-medic:field-add-institution-title" ] } },
      { "data_is_empty" : { "data" : [ "profile2:user:profile-medic:field-doctor-workplace" ] } }
    ],
    "DO" : [
      { "entity_create" : {
          "USING" : {
            "type" : "node",
            "param_type" : "institution",
            "param_title" : [ "profile2:user:profile-medic:field-add-institution-title" ],
            "param_author" : [ "site:current-user" ]
          },
          "PROVIDE" : { "entity_created" : { "entity_created" : "Created entity" } }
        }
      },
      { "data_set" : { "data" : [ "entity-created:language" ], "value" : "ru" } },
      { "data_set" : {
          "data" : [ "entity-created:field-institution-type" ],
          "value" : [ "profile2:user:profile-medic:field-add-institution-type" ]
        }
      },
      { "entity_save" : { "data" : [ "entity-created" ] } },
      { "redirect" : { "url" : [ "entity-created:edit-url" ] } }
    ]
  }
}

that is wrong?

thank u

Comments

DenisVS’s picture

I'm have same issue too.
Notice: Undefined property: stdClass::$nid in eval() (line 3 of /path/www/sites/all/modules/rules/modules/php.eval.inc(146) : eval()'d code).

My code:

global $base_url, $base_path;
 
$url = $base_url . $base_path . drupal_get_path_alias('node/' . $node->nid);
 
$services = array(
  'http://ping.blogs.yandex.ru/RPC2',
  'http://blogsearch.google.com/ping/RPC2',
  'http://rpc.pingomatic.com',  
  'http://xping.pubsub.com/ping/',
  'http://rpc.weblogs.com/RPC2',
  'http://blogpeople.net/servlet/weblogUpdates',
);
 
foreach($services as $service){
  $ping = xmlrpc($service,  array('weblogUpdates.ping' => array($node->title, $url)));
 
  if (!$ping)
    watchdog('ping', 'Error sending ping to "%site_name".', array('%site_name' => $service));
}
pebosi’s picture

Try setting the "immediate" checkbox on "entity_save" action, this works for me.

ruthverena75’s picture

Component: Rules Engine » Rules Core

i have the same problem, i searched for the checkbox and could not find it.
where do i find the setting/checkbox "immediate"?
thx in advance

TR’s picture

Issue summary: View changes
Status: Active » Closed (outdated)