Hello,

I made a simple rule for Facebook autopost where I want to fetch the node body value or the summary.
But I can't access the appropriate data selectors : no node:body:value nor node:summary are proposed when I want to set a data value for my Facebook autopost field.

I previously done the exact same rule on another website and everything went right (only older version of Drupal and rules).

I have searched for hours, i can't understand what I am missing.
Thanks for your help !

Here is the rule :

{ "rules_post_image_to_facebook" : {
"LABEL" : "Post image to Facebook",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "rules", "fb_autopost_entity" ],
"ON" : { "node_insert" : [] },
"IF" : [
{ "node_is_of_type" : { "node" : [ "node" ], "type" : { "value" : { "article" : "article" } } } },
{ "node_is_published" : { "node" : [ "node" ] } },
{ "entity_has_field" : { "entity" : [ "node" ], "field" : "body" } }
],
"DO" : [
{ "entity_create" : {
"USING" : {
"type" : "facebook_publication",
"param_type" : "photo",
"param_user" : [ "site:current-user" ]
},
"PROVIDE" : { "entity_created" : { "entity_created" : "Entit\u00e9 cr\u00e9\u00e9e" } }
}
},
{ "data_set" : {
"data" : [ "entity-created:field-facebook-source" ],
"value" : [ "node:field-image" ]
}
},
{ "data_set" : {
"data" : [ "entity-created:field-facebook-message" ],
"value" : [ "node:body" ]
}
},
{ "publish_to_facebook" : {
"USING" : { "publication" : [ "entity-created" ], "pages" : "xxxxxxxxxxxxx" },
"PROVIDE" : { "facebook_publication_id" : { "facebook_publication_id" : "Facebook publication returned ID" } }
}
},
{ "data_set" : {
"data" : [ "entity-created:facebook-id" ],
"value" : [ "facebook-publication-id" ]
}
},
{ "entity_save" : { "data" : [ "entity-created" ], "immediate" : 1 } }
]
}
}

Comments

TR’s picture

Status: Active » Postponed (maintainer needs more info)

As I said in #2789985: previous body summary is used?, it's not clear if this is even a Rules problem. Can you simplify this? Your Rule will not import - it fails integrity checks. Likewise, your Rule requires us to completely install and configure a number of extra modules (including downloading and installing external libraries). Can you reproduce the problem without all the data_set actions or the publish_to_facebook action (just create the entity and display the body summary in a system message)? Can you simplify the example and remove the use of the fb_autopost module entirely?

TR’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

No further information provided.