Needs review
Project:
Facebook Page Rules
Version:
7.x-1.x-dev
Component:
User interface
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Apr 2012 at 22:33 UTC
Updated:
26 Apr 2014 at 08:55 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
fotuzlab commentedThe message says "This api cal lrequires a valid app_id"
Could you please confirm your app id and app secret at 'admin/config/people/facebook_page_rules' are same as the ones you provided for fboauth?
Comment #2
ShadowMonster commentedYes I check it few times to be sure.
As I wrote post as user is working but not post as admin.
Also I have to change Deprecate offline access: to disabled for FB do not return me error when authorize app. Is there some other requirements for App settings on FB?
Comment #3
ShadowMonster commentedI Debug little a bit and I found problem:
in function function facebook_page_rules_post_to_wall_as_admin there is not getting access token so I made fast fix
Comment #4
fotuzlab commentedTo post to wall as admin, we need page access token which is different from user's access token. It is stored as a variable named 'facebook_page_rules_page_token'
This module does not use offline_access. Hence disabling/enabling it should not be effective.
I gave it a few trials and could not reproduce the issue.
Could you do the following and let me know the results. It would help me get closer to the issue.
Moreover, there are a few issues left to be fixed. I'll look into them this weekend. Hopefully, there would be a stable release soon.
Comment #5
ShadowMonster commentedWell, I'm sure I been doing everything right - in my case:
$access_token = variable_get('facebook_page_rules_page_token', NULL);
just do not return access token like it is not saving to this variable.
I check variable table in DB there is not facebook_page_rules_page_token so maybe it is problem when installing your module and the variable is not created anyway lets see if other will have this problem
Comment #6
fotuzlab commentedThis variable is stored when you save the configuration. (line #62 in facebook_page_rules.inc)
If you see status message as 'Configuration saved', it should be set. Else you see a warning message.
I created a new facebook page with default settings. It is working fine for me.
Check this link http://www.facebook.com/pages/Test/360107460707532
PS: Are you using latest dev version?
Comment #7
Josher commentedRunning latest dev version and having the same issue.
Receive these notices when saving App ID/ Secret configuration.
Comment #8
ShadowMonster commentedWell and this is the point.
I been look into this file. function facebook_page_rules_validate is never called so to fix it I have to add:
to facebook_page_rules_settings_form function
also $access_token is not received from variable so I have to do:
after it it make it work correctly and variable is saved.
Comment #9
Josher commentedGetting somewhere now.
Comment #10
milos.kroulik commentedShadowMonster, can you, please, create patch based on your fix in #8? I also experience error mentioned in #7.
Josher, were you able to solve the problem? Thanks.
Comment #11
goekhanc commentedI would appreciate a patch file, too.
but what i dont understand is, why this module does not depend on the fboauth module or the facebook rules module. i think the code from post #8 assumes both of them to be active, doesnt it?
Comment #12
Josher commentedGot caught up with a few other items. It was a bummer the code snippets didn't work for my set up.
Comment #13
webroru commentedShadowMonster, can you, please, create patch based on your fix in #8?
Comment #14
webroru commentedI can post messages on the wall page as a user, but when I admin I can't.
Comment #15
ShadowMonster commentedsorry guys will try create patch on weekend - very busy all time :(
Comment #16
kika commentedAny update on this? Facebook Page Rules seems a great liteweight component, very much needed.
Comment #17
spaceboii commentedOne aspect that haven't really commented is the fact that "http_build_query", used in "facebook_page_rules_post()" for data formatting has change since php 5.3..
Solves the trouble some would have with strange errors regardning incomplete data sent ...
http_build_query($array, '', '&');
Hopes this helps someone...
Comment #18
BManuel commentedHey guys can someone please roll a patch for a working version, I am ready to chip in to get this done.
Thanks to anyone who takes up this challenge
BM
Comment #19
Pls commentedI suspect that this problem is completely equal to facebook_rules modules issue.
Unfortunetely I don't have time to test my patch right now, but I'm pretty sure it will work. Any feedback appreciated!
Comment #20
BManuel commented@Pls I just did the test and got same error
Message: (#200) This API call requires a valid app_id.
Type: :OAuthException
Code: 200
User: :uid
SEVERITY error
I know my app_id is correct and I even enabled/disabled fboauth to see if that would help.
Also I get a "Message: Type: :Code: User: :uid" error after saving the app_id/secret key
Message:
Type: :
Code:
User: :uid
Thanks so much for your time and like I said earlier I am willing to chip-in if that's what needed to get this module working properly.
Drupal needs a light weight way to communicated with FB.
BM
Comment #21
Pls commented@BManuel, thanks for testing patch. I will try to make another patch when I have time. Changing to needs work.
Comment #22
Dr_Whut commentedOk so I got this working by tracing back up the processes. The problem as far as I can see was that did didn't like encoding the ?q= part of the redirect URL of the OAUTH post.
Specifically at line 56
I managed to get this working by hardcoding it to
This is obviously not a lasting fix, but it's a start.
Oh and in addition, the Undefined Index errors are coming from the watchdog functions.
Comment #23
BManuel commentedHi,
I am still getting the same error after making the change. Can you pls attached a copy of your version of the module here. That will save many of us the trouble of trying to get it right.
Thanks
BM
Comment #24
Dr_Whut commentedOk here it is in patch form.
Be aware that this is a messy hotfix and mainly to better explain what I did. I do not recommend just flat patching this.
Comment #25
icampanaHere is the right fix, the problem was generated if you had clean urls as stated by Dr_Whut, the problem with hist patch on #24 is that if you ever disable clean_urls you would have to edit the module again, and besides it is not too "Drupalistic".
The right way is to use the url function, that way it handles the propper generation of the URL and facebook doesn't complain because the URL changed during the token exchange, no matter if you use clean urls or not.
The original code looked like this:
$redirect_url = $GLOBALS['base_url'] . '?q=' . 'facebook_page_rules';And now it should remain as this:
$redirect_url = url('facebook_page_rules', array('absolute' => TRUE));I'm also attaching a patch to make the change.
Comment #26
kirkcaraway commentedOK, I have applied the patches, and now the errors are gone. However, there are no posts showing up on the Facebook page, either.
The patch in #24 removed the Watchdog thing, so I'm not sure if the module is working, or if it's just not showing there is an error.
Anyone else get this to work?
Thanks.
Comment #27
Funkwarrior commented#25 Work fine for me, thanks!
Comment #28
bsandor commenteddeleted comment
Comment #29
mrpeanut commentedTried the patch from #25 and it did not apply cleanly for me:
So I then manually replaced the two lines and I'm still getting the #200 error. Should those changes still be working?
Comment #30
Sherif Darwish commented#25 worked for me and posted to facebook
The important point to consider is that you should visit admin/config/system/facebook_page_rules and write all the details then after clicking save you have to check that the below variables are set (using sql or php mysqmin)
select * from variable where name like 'facebook_page_rules%';
among the existing variables there should be facebook_page_rules_page_token and facebook_page_rules_user_token
if you found them then try posting again and see if it will work, if not then you have to check the watchdog to see what was the error in setting those up