Migration Module – Rules not working properly

Hi There,

I’m using the migration module to import information from a legacy database and having a little bit of trouble.

The migration class in question imports pets from a table (old db) and creates new pet nodes in the drupal database. So far, so good. The pet migration class is also connected to the user migration class. This means that I can set the author (uid) of each pet to the appropriate new drupal user. Again so far so good. This also means the setup is more or less the same as the old database.

The problem is that I have got a rule to create a pet home page node when a pet is created. Again, when the pets are imported using the migration module this works; the rule appears to run. However, the new pet home page nodes all get the same author, which is the user running the migration script. The pet home page nodes should actually get the author of the pet that triggered the rule.

So my question is how do I get the rule to use the pet node author and not the current user.

Hope this make sense to someone. The rule code is shown below:

$items[‘rules_create_pet_home_page’] = entity_import(‘rules_config’, ‘{ “rules_create_pet_home_page” : {
“LABEL” : “Create pet home page”,
“PLUGIN” : “reaction rule”,
“WEIGHT” : “1”,
“ACTIVE” : false,
“OWNER” : “rules”,
“REQUIRES” : [ “rules”, “path” ],
“ON” : { “node_insert–pet_table” : { “bundle” : “pet_table” } },
“DO” : [
{ “entity_create” : {
“USING” : {
“type” : “node”,
“param_type” : “pet_home”,
“param_title” : “Pet home page”,
“param_author” : [ “node:author” ]
“PROVIDE” : { “entity_created” : { “pet_home_created” : “Pet home entity” } }
{ “node_path_alias” : { “node” : [ “node” ], “alias” : “/[node:author]/[node:nid]/home” } }

Note: the actual name of the pet node is pet_table and not just pet.

For author I have node:author and not site:current-user, so I would expect the new pet home page node to use the author of the pet (pet_table) node and not the user running the import script.

Thanks in advance for your help.

Drupal version: 

Source: https://www.drupal.org/taxonomy/term/4/feed