Truly awesome module, thanks for providing a foundation for us to play! Just been watching your drupalcon presentation and playing with the module all day.
I've managed to get content coming in from a view but when I try and view my facebook app from my test facebook user who I added to the developer list in my app settings, I get this:
Fatal error: Uncaught exception 'FacebookRestClientException' with message 'Session key invalid or no longer valid' in /home/psjt/public_html/sites/all/modules/fb/facebook-platform/client/facebookapi_php5_restlib.php:1314 Stack trace: #0 /home/psjt/public_html/sites/all/modules/fb/facebook-platform/client/facebookapi_php5_restlib.php(136): FacebookRestClient->call_method('facebook.fql.qu...', Array) #1 /home/psjt/public_html/sites/all/modules/fb/fb.module(332): FacebookRestClient->fql_query('SELECT uid2 FRO...') #2 /home/psjt/public_html/sites/all/modules/fb/fb.module(570): fb_get_friends() #3 /home/psjt/public_html/includes/module.inc(406): fb_node_grants('649945666') #4 /home/psjt/public_html/modules/node/node.module(2826): module_invoke_all() #5 /home/psjt/public_html/modules/node/node.module(2837): node_access_grants() #6 /home/psjt/public_html/modules/node/node.module(2860): node_access_view_all_nodes() #7 /home/psjt/public_html/includes/module.inc(386): node_db_rewrite_sql(Object(stdClass), 'view') #8 /home/psjt/pub in /home/psjt/public_html/sites/all/modules/fb/facebook-platform/client/facebookapi_php5_restlib.php on line 1314
The only thing that mentions sessions in the drupal facebook node is Facebook infinite session settings, but that says it's for non-canvas pages. I put my facebook id in there anyway, and had no infinite session key so followed the link underneath which says if you haven't one then click here but that goes to a bum page so i copied the key at the end of the url which seems to be the same as my api key and pasted it there anyway. Still no difference tho.
Also getting:
# warning: Invalid argument supplied for foreach() in /home/psjt/public_html/sites/all/modules/fb/fb_app.module on line 198.
# warning: Invalid argument supplied for foreach() in /home/psjt/public_html/sites/all/modules/fb/fb_app.module on line 266.
Whenever I edit or update the facebook app node in drupal. Got the latest version of your module.
Finally, although haven't really looked into this yet, but all the links to 'read more', etc. point to the same place as my site but with the facebook url in front - like the next page links.
Comments
Comment #1
Dave Cohen commentedDoes your app require either login or add? If not, I think I know what's going on. (Even though its a canvas page, you still do not have a session).
The last line of you post made no sense to me. If its an issue, please submit another issue describing it completely, including some actual URLs.
Comment #2
Anonymous (not verified) commentedOK, I got the infinite key working (tests ok on the drupal site test link) but now I get the following error about not being able to look up friends:
Fatal error: Uncaught exception 'FacebookRestClientException' with message 'Can't lookup all friends of 649945666; only for the logged in user (639963971) or for pairs of users' in /home/psjt/public_html/sites/all/modules/fb/facebook-platform/client/facebookapi_php5_restlib.php:1314 Stack trace: #0 /home/psjt/public_html/sites/all/modules/fb/facebook-platform/client/facebookapi_php5_restlib.php(136): FacebookRestClient->call_method('facebook.fql.qu...', Array) #1 /home/psjt/public_html/sites/all/modules/fb/fb.module(332): FacebookRestClient->fql_query('SELECT uid2 FRO...') #2 /home/psjt/public_html/sites/all/modules/fb/fb.module(570): fb_get_friends() #3 /home/psjt/public_html/includes/module.inc(406): fb_node_grants('649945666') #4 /home/psjt/public_html/modules/node/node.module(2826): module_invoke_all() #5 /home/psjt/public_html/modules/node/node.module(2837): node_access_grants() #6 /home/psjt/public_html/modules/node/node.module(2860): node_access_view_all_nodes() #7 /home/psjt/public_html/includes/module.inc(386): n in /home/psjt/public_html/sites/all/modules/fb/facebook-platform/client/facebookapi_php5_restlib.php on line 1314
Comment #3
Dave Cohen commentedWhich is your infinite session user, 649945666 or 639963971? Is this happening on a canvas page?
What are your settings for "require login" and "create local account" on the facebook app edit tab?
I'm not sure why this is happening, but I'm sure we'll figure it out.
Comment #4
Anonymous (not verified) commentedHiya,
I'm the user with 666 in the ID - nice ;)
I've tried it with no require login, require login, and require install - all the same. Set it to not create a local account (I had 300 drupal members yesterday and 400 today so gotto work that one out somehow, but that's another story...saw mentioned in another issue so thought I'd get this sorted first, do things step by step) and took off the role ID as I read in the other issue that was causing probs.
Comment #5
Dave Cohen commentedI'm still not clear which id is the infinite session user, and which is the canvas page user?
I suspect that somehow during your various settings, you've got a drupal user associated with the wrong facebook account. Maybe.
Can you send the results of "SELECT * FROM authmap WHERE authname LIKE '%facebook%';"?
If my code created 100 new users - oops! - sorry.
Comment #6
Anonymous (not verified) commentedSorry, I should've been more explicit. My facebook ID is 649945666, the other is my dummy account. I created the infinite session ID using my facebook ID.
I have 100 new users not because of your code, but because we've got a cool site ;) We're giving members shares, 'Blogging for Stock' we call it, and it's catching on...
authmap says aid 8, uid 0, authname 649945666@facebook.com, module fb_user. My drupal uid is 5, but I presume it's 0 cos that's what I set it to default to in the facebook app I created on drupal.
p,s, I just *know* this is gonna turn out to be something simple I've overlooked, it's getting to look like one of those... fairly sure I followed all the instructions though!
Comment #7
Anonymous (not verified) commentedalso I'm still getting the following error whenever I save the facebook app in drupal:
# warning: Invalid argument supplied for foreach() in /home/psjt/public_html/sites/all/modules/fb/fb_app.module on line 198.
# warning: Invalid argument supplied for foreach() in /home/psjt/public_html/sites/all/modules/fb/fb_app.module on line 266.
..which perhaps has something to do with it or not. I've been reading your code, the facebook code, and the facebook developer doc but I'm still unsure as to why it's not able to find friends of the test user who's trying to look at the app.
Comment #8
Dave Cohen commentedThe reason why its failing to look up friends is that to facebook, you are your dummy account, but to the fb modules, you are user "666". So the fb modules are asking, "tell me all friends of user 666". And facebook replies, no that's private info.
The fb modules are confused. For starters, its written to the authmap for uid 0 (anonymous), which it should not do. And second, its trusting the authmap information instead of the facebook id it could get from the facebook api.
I'm not immediately certain how to reproduce this, or fix it. But I'll see what I can do when I get a chance. Thanks for answering all the questions.
When you wrote about the 100 new accounts, I assumed you were playing with the facebook stuff on a development server somewhere. I recommend you work on the facebook app somewhere other than your production server. Then when you're sure its ready, move it over to production.
Comment #9
Anonymous (not verified) commentedHiya,
That's the conclusion I came to, and I was gonna try swapping around the ID that your function sent through but presumed that as no-one else had the same problem, that wasn't the problem...!
I'll have another play this weekend. I will move it to the dev server, just had some problems with my dev server lately so was playing with fire ;)
Thanks again,
Steve
Comment #10
Letharion commentedSince Drupal 5 is no longer supported, I'm taking the liberty to close all FB D5 support requests.