Hello, I'm trying to use Simple Facebook Post Wall to post content in FB's Wall. I've been checking the code and there's something I don't understand. According to README.txt I have call drupal_get_form this way to get the form printed:
drupal_get_form('simple_fbwall_post_button', $example_payload);
The point is that API Drupal 6 page is telling that drupal_get_form should receive just 1 argument.
http://api.drupal.org/api/drupal/includes--form.inc/function/drupal_get_form/6
And, on the other hand, in the .module file there's no function called simple_fbwall_post_button, but there's one called simple_fbwall_post_button_form. I'm saying that because when I print the form, Drupal gives me an errro message about a callback not defined.
Greetings.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | Screen shot 2011-03-09 at 3.11.03 PM.png | 17.53 KB | scothiam |
Comments
Comment #1
cibonato commentedThis is the error message I get when using drupal_get_form according to what is written in README.txt file:
warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'simple_fbwall_post_button' was given in /var/www/drupal/includes/form.inc on line 376.I tried replace
drupal_get_form('simple_fbwall_post_button', $example_payload);withdrupal_get_form('simple_fbwall_post_button_form', $example_payload);and then Drupal started complaining about the number of arguments (I was expecting this kind of issue because simple_fbwall_post_button_form must receive 3 arguments, not only 2).Greetings.
Comment #2
Anonymous (not verified) commentedHmmm, we might need to update the documentation.
When I use this module, I tack on an additional ID to the end of the form name. For example, my call looks like this:
We've used HOOK_forms(), so that it is possible to use the Facebook form multiple times on the page. But that may also be why you are unable to call the form with the only the form name.
Comment #3
scothiam commentedDid you get it working cibonato? I'm working on it myself, but I'm also in the process of learning the hooks, not sure which I'm doing wrong ;)
I've successfully got the 'share' button and the pop-up with a text area to show up (see image attached), no image, no captions, etc... Upon submitting I get the "An error occured while posting to your facebook wall. Please refresh the page and try again."
Heres my code, based on the example in the read me and the changes mentioned in #2... a nudge in the right direction would be greatly appreciated, thanks
Comment #4
scothiam commentedFixed! Just moved the "payload" within the function and it is now working swimmingly... Any feedback, critique, or suggestions would be greatly appreciated. Thanks!!
Comment #5
scothiam commented... and it has stopped working for me...
a few months later, a couple core updates, many other module updates... the facebook developer interface, options, also seem to look different...
The form generates fine, but fails to post anything to facebook.
"An error occured while posting to your facebook wall. Please refresh the page and try again."
I've tried reverting to the most basic 'hello world' script... both beta and dev versions... no luck so far..
any fixes/updates on the horizon?
cheers,
Comment #6
Anonymous (not verified) commentedWall posting is still working for me... Is there any other info you can dig up about that error message?
Comment #7
scothiam commentedthanks for the response, and sorry for the delay, just rolled out a new site. I'll set up a clean site and test again in the next few days. At this point I'm betting there is a conflict with another module or something in my custom theme. I'll add in other elements until I get it to break again ;)
Update: tried on a clean install, no luck. Tried on another host, no luck... won't be able to dig deeper for a week or two...
Comment #8
Anonymous (not verified) commentedI think Facebook may have switched things up on us.
Comment #9
Anonymous (not verified) commentedLobo235 has found the problem. Facebook has gotten more strict about the structure of the payload. In our case, I think we sent a link as an array, but it needs to be a string. I'll have him chime in with the details.
Comment #10
scothiam commentedI've since had success using the facebook social modules + open graph meta tags module to manipulate what is posted to facebook... give it a shot if you are with out a solution. cheers