When I add a new article my facebook autopost uses the correct image, correct title, and the correct URL but the body summary is from the previous article?
{ "rules_fb_new_artice" : {
"LABEL" : "FB - New Artice",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"TAGS" : [ "facebook" ],
"REQUIRES" : [ "rules", "php", "fb_autopost_entity" ],
"ON" : { "node_insert--article" : { "bundle" : "article" } },
"DO" : [
{ "entity_create" : {
"USING" : {
"type" : "facebook_publication",
"param_type" : "post",
"param_user" : [ "site:current-user" ]
},
"PROVIDE" : { "entity_created" : { "entity_created" : "Created entity" } }
}
},
{ "data_set" : {
"data" : [ "entity-created:field-facebook-name" ],
"value" : [ "node:title" ]
}
},
{ "data_set" : {
"data" : [ "entity-created:field-facebook-picture" ],
"value" : "\u003C?php\r\n if($node-\u003Efield_image) {\r\n if(array_key_exists(0, $node-\u003Efield_image[\u0027und\u0027])) {\r\n $fid = $node-\u003Efield_image[\u0027und\u0027][0][\u0027fid\u0027];\r\n\t $result = db_select(\u0027file_managed\u0027, \u0027fm\u0027)\r\n\t\t-\u003Efields(\u0027fm\u0027, array(\u0027uri\u0027))\r\n\t\t-\u003Econdition(\u0027fm.fid\u0027, $fid,\u0027=\u0027)\r\n\t\t-\u003Eexecute()\r\n\t\t-\u003EfetchAssoc();\r\n $path = $result[\u0027uri\u0027];\r\n $style_name = \u0027large\u0027;\r\n print (image_style_url($style_name, $path));\r\n }\r\n }\r\n?\u003E"
}
},
{ "data_set" : {
"data" : [ "entity-created:field-facebook-link" ],
"value" : [ "node:url" ]
}
},
{ "data_set" : {
"data" : [ "entity-created:field-facebook-description" ],
"value" : [ "node:body:summary" ]
}
},
{ "publish_to_facebook" : {
"USING" : { "publication" : [ "entity-created" ], "pages" : "140044559353737" },
"PROVIDE" : { "facebook_publication_id" : { "facebook_publication_id" : "Facebook publication returned ID" } }
}
},
{ "entity_save" : { "data" : [ "entity-created" ] } }
]
}
}
Comments
Comment #2
e0ipsoThis seems an issue with your rules configuration.
Comment #3
sifuhall commentedI'm sure I don't understand.
Should I be using something other than node:body:summary?
Comment #4
sifuhall commentedanyone?
Comment #5
sifuhall commentedLooks like if I rebuild the rules cache it works correctly but only for the next entry then I need to rebuild the rules cache again.