Needs review
Project:
Facebook OAuth (FBOAuth)
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
8 May 2012 at 17:46 UTC
Updated:
12 Oct 2015 at 13:03 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
grasmash commentedComment #2
grasmash commentedSwitching to needs review.
Comment #3
quicksketchThis looks pretty good, but I'm questioning the value being provided here. The two links you included:
#1440254: Performing graph queries in the background with access token, not as an action
#1420710: Initiating an action when user browses to a page
The first one isn't helped by this feature request. Since FBOAuth doesn't let you execute anything "in the background".
The second request is only helped marginally, as was found in that issue, it's only 3 lines of code to execute the drupal_goto() yourself. The creation of a function that wraps around drupal_goto() may lead developers to believe they could execute the code inline, but certainly wouldn't work. For example most developers would expect they could do something like this:
But this obviously isn't going to work because fboauth_request() doesn't return a value. In fact if you put *any* code below fboauth_request(), it would never get executed. I don't think the name of the function makes clear its purpose. The naming makes me think it's going to operate like drupal_http_request(), not a drupal_goto().
Comment #4
grasmash commentedAgreed on both points.
1) The name of the function could be clearer. Maybe something like fboauth_execute_action_redirect().
2) This doesn't directly address either of the mentioned issues. It's only obliquely related.
However, I found the changes in this patch to be useful in two use cases:
1) Creating a menu callback that will execute an action.
2) Creating a $form['submit'][] handler that will execute an action.
Beyond that, splitting out the fboauth_build_query() and fboauth_build_scope() functions made it easier for me to extend fboauth in my own custom modules, and to better understand steps involved in building the link.
Comment #5
Pedro Lozano commentedI've created a sandbox project to permanently store the access_tokens, which can be used to execute facebook api call programatically without user interaction our without having to redirect the user to facebook for executing an action.
http://drupal.org/sandbox/pl2/1600932
@quicksketch I'd appreciate your feedback on this since I'm not sure about the security implications that storing access_tokens may have and how this fits with facebook's policies about api calls.
I've also developed a module that makes use of the token store to post to facebook from the node form: http://drupal.org/sandbox/pl2/1600946
Comment #6
jacobpov commentedWill this be stable any time soon ?
Comment #7
mototribe commentedsorry, wrong post, please delete.
Comment #8
norman.lolAt least for
POSTqueries like apublish_actionshttps://www.drupal.org/node/1420710has helped me a lot. I triggered following code from a custom form submit where I also prepared some
$_SESSIONvalues I then could use as postmessage,pictureor what so ever.