Hi, thanks for the excellent module : I have it working for posting on a user's wall when user sign-ups.
BUT...
It's a classifieds website: user posts a node, then admin publishes the node after validation.
I would like to have the node (part of it) published on the user's FB wall once it is published by the admin.
However, I can't have it working, although the debug mode says that the rule is actually fired...
Here is the rule export:

{ "rules_pub_sur_facebook" : {
    "LABEL" : "post annonce sur Facebook",
    "PLUGIN" : "reaction rule",
    "REQUIRES" : [ "rules", "facebook_rules" ],
    "ON" : [ "node_update" ],
    "IF" : [
      { "node_is_of_type" : { "node" : [ "node" ], "type" : { "value" : { "annonce" : "annonce" } } } },
      { "node_is_published" : { "node" : [ "node" ] } }
    ],
    "DO" : [
      { "facebook_rules_post_to_my_wall" : { "message" : "Je viens de passer une annonce sur [site:url], [site:slogan].\r\nMon annonce :\u003Ca href=\u0022[node:url]\u0022\u003E [node:field_titre].\r\n[node:field_photos] \u003C\/a\u003E" } }
    ]
  }
}

Any idea of what I am doing wrong?

Comments

fotuzlab’s picture

Is there any entry in the watchdog for the failed action?

Louis Bob’s picture

No, there is no error in the log.
Just this in the "Rules Evaluation Journal":

0 ms Reacting on event Après mise à jour d'un contenu existant.
102.683 ms Evaluating conditions of rule post annonce sur Facebook. [edit]
103.575 ms The condition node_is_of_type evaluated to TRUE [edit]
103.839 ms The condition node_is_published evaluated to TRUE [edit]
103.859 ms AND evaluated to TRUE.
" Rule post annonce sur Facebook fires. [edit]
128.224 ms Finished reacting on event Après mise à jour d'un contenu existant.

fotuzlab’s picture

I'll just try it on my machine and get back on this issue.

fotuzlab’s picture

StatusFileSize
new369.15 KB

Hi Louis,
I imported the rule you posted and it worked for me.

What I did:

1. Updated 'node type' in conditions to articles for my local setup.
2. Created an article.
3. went to node/*/edit, published and saved
4. the message was posted to my wall(See attached SS).

Louis Bob’s picture

Status: Active » Closed (fixed)

Thanks a lot for your reply.
I realized what was wrong for me: since i was using test accounts on FB, the email is not operational therefore it was not working.
I have tested it on a real FB account, and it works just fine!
Thanks again :)

BManuel’s picture

Component: Miscellaneous » Code
Category: support » bug
Status: Closed (fixed) » Active

I get this error when I try to post
My log entry

Message: (#100) Missing message or attachmentType: ...

Message: (#100) Missing message or attachment
Type: :OAuthException
Code: 100
User: 1

I have adjusted the rules a 100x still getting the same error.

What are my doing wrong?
Thanks
BM

fotuzlab’s picture

Code 100 is returned if the message is missing.
Can you confirm that the token you used in Rules for 'message' is not returning NULL for above particular case?

BManuel’s picture

I tried it with token and with just plain text. same result. So I don't believe it is a token issue. And I tried it with a few apps so, issue is not with apps either.
Thanks
BM

BManuel’s picture

Just tried it on a fresh install. Same result.

fotuzlab’s picture

Hope there are no major API changes by facebook. Let me try it myself.
Can you share your exported rule?

BManuel’s picture

Using same from above here. only changed the node type to article and blog.
Thanks
BM

BManuel’s picture

Hi on a another new install it work twice then just stop working. My debug shows that rules fires, so it is not a rule problem. But I have gotten this error twice now when deauthorizing a user and trying to authorize them again

PDOException: SQLSTATE[HY000]: General error: 1364 Field 'token' doesn't have a default value: INSERT INTO {facebook_rules_user_tokens} (uid, user_grant) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1); Array ( [:db_insert_placeholder_0] => 1 [:db_insert_placeholder_1] => ) in facebook_rules_profile_submit() (line 94 of /data/disk/o1/distro/001/drupal-7.14.2-dev/sites/all/modules/facebook_rules/facebook_rules.module).

I really need this module so any pointers are greatly appreciated
BM

BManuel’s picture

Status: Active » Closed (fixed)

Just needed to add extended permission to the facebook apps. Thanks for your time

BManuel’s picture

Status: Closed (fixed) » Active

Sorry had to re-open, problem is back, curiously this works for 4-6 posts then start given "no message or attachment errors".

ajmartin’s picture

I'm also experiencing this exact issue. Nothing more I can report than what is already stated by BManuel. I used the exported rule posted above and my own rules to no avail.

I'm not sure what is meant by extended permissions, but that doesn't appear to be the solution anyway....

ajmartin’s picture

Same error when on event "User registered using Facebook connect".

Pls’s picture

I'm suspecting that http://stackoverflow.com/a/9959706 could be the case, probably Facebook made an API change. Digging on it right now.

Pls’s picture

Title: can't publish on wall when node is published » Can't publish a post to user's wall due to #100 Missing message error
Priority: Normal » Critical
Status: Active » Needs review
StatusFileSize
new534 bytes

Actually, this is whole easier fix than expected. The problem was that amp; was prepended before message parameter and that caused this #100 error (which didn't understand message parameter when there is amp; characters before it).

I think this is critical bug, as it's not working without this fix. Attached a patch to fix it and it works on my side. Would love to get any feedback.

BManuel’s picture

Thanks @Pls that fixed the problem for me. Do you by any chance use the http://drupal.org/project/facebook_page_rules module that too has some bug that makes it unusable

Pls’s picture

@BManuel, thanks for testing my patch.

Other testers are welcome too! Please change status to RTBC if you feel that patch clearly solved problem.

Pls’s picture

Version: 7.x-1.2 » 7.x-1.3

Changing version.

BManuel’s picture

Status: Needs review » Reviewed & tested by the community
fotuzlab’s picture

Status: Reviewed & tested by the community » Fixed

Thanks PLS for the patch. I have committed it to dev and attributed the commit to you :)

Cheers

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.