Download & Extend

App broken after enabling friends blocks

Project:Drupal for Facebook
Version:6.x-3.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Dave Cohen
Status:closed (fixed)

Issue Summary

I tried enabling the blocks for Facebook friends who have authorized the current app - and - Invite Facebook friends to install the current app

As soon as I clicked save, I get this error on the screen:

Facebook API exception Parser error: unexpected ')' at position 92..
#0 /var/clients/client0/web2/web/sites/all/modules/fb/facebook-platform/php/facebookapi_php5_restlib.php(834): FacebookRestClient->call_method('facebook.fql.qu...', Array)
#1 /var/clients/client0/web2/web/sites/all/modules/fb/contrib/fb_friend.module(122): FacebookRestClient->fql_query('SELECT uid FROM...')
#2 [internal function]: fb_friend_block('view', 'fb_friend_invit...')
#3 /var/clients/client0/web2/web/includes/module.inc(450): call_user_func_array('fb_friend_block', Array)
#4 /var/clients/client0/web2/web/modules/block/block.module(473): module_invoke('fb_friend', 'block', 'view', 'fb_friend_invit...')
#5 /var/clients/client0/web2/web/includes/theme.inc(1580): block_list('right')
#6 [internal function]: theme_blocks('right')
#7 /var/clients/client0/web2/web/includes/theme.inc(617): call_user_func_array('theme_blocks', Array)
#8 /var/clients/client0/web2/web/includes/theme.inc(1774): theme('blocks', 'right')
#9 /var/clients/client0/web2/web/sites/www.menashalibrary.org/themes/fb_fbml/template.php(30): template_preprocess_page(Array, 'page')
#10 [internal function]: fb_fbml_page('
$_REQUEST:
Array
(
    [q] => admin/build/block/list/fb_fbml
    [3b30ab62198bbd5e409f902ba37827e4] => f26b5a456dc7448494cb86f3590fdd6f
    [3b30ab62198bbd5e409f902ba37827e4_expires] => 1243695600
    [3b30ab62198bbd5e409f902ba37827e4_session_key] => 3.Q8myCw4rxMHcYtbVz41pHQ__.86400.1243695600-1335487366
    [3b30ab62198bbd5e409f902ba37827e4_ss] => XRf2tzQqrsk4iZE2xTDmuQ__
    [3b30ab62198bbd5e409f902ba37827e4_user] => 1335487366
    [__utma] => 116135066.3695051843684078600.1226549338.1233162571.1233166436.73
    [__utmz] => 116135066.1228258210.9.2.utmcsr=upgrade.menashalibrary.org|utmccn=(referral)|utmcmd=referral|utmcct=/admin/settings/performance
    [base_domain_3b30ab62198bbd5e409f902ba37827e4] => menashalibrary.org
    [fb_canvas_11722_SESS8ca7c826e2a224dd5c7e4d73cb733038] => fb_canvas_11722_2.smnHw7rUiStep_nnWiuppw__.86400.1242136800-1335487366
    [fbsetting_3b30ab62198bbd5e409f902ba37827e4] => {"connectState":1,"oneLineStorySetting":2,"shortStorySetting":2,"inFacebook":false}
    [SESS8ca7c826e2a224dd5c7e4d73cb733038] => fb_connect_3.Q8myCw4rxMHcYtbVz41pHQ__.86400.1243695600-1335487366
    [_csuid] => 46090f09039ddec8
    [has_js] => 1
    [icid] => 0
    [idsc] => 0
    [ih1] => 264
    [ih2] => 132
    [iw1] => 132
    [iw2] => 632
    [sessionCookie] => L0FWOB792SYMH019LJBXAG9JFTTMSXUF
    [wooTracker] => 2EE2OG9A4I8X5VOQUQQWKHJ3MPNAXZXE
)


REQUEST_URI:
/admin/build/block/list/fb_fbml

Since that's all that's on the screen, I'm not able to remove those blocks. so, now my app is just showing that error. Any ideas how I can fix this?

Comments

#1

Assigned to:Anonymous» Dave Cohen

Whoops. Look for:

    // Our blocks use current application                                      
    global $fb, $fbu;

and make it say
    // Our blocks use current application                                      
    global $fb, $fb_app;

Will check this in when I get a moment.

#2

I made the change you mentioned in fb_friend.module and now I get this error on the screen. (it was easier taking a screenshot)

AttachmentSize
Picture 1.png 50.83 KB

#3

I can confirm.

I get the same error.

Chris

#4

Status:active» fixed

Thanks for pointing this out, guys.

I've checked this patch in.

AttachmentSize
fb_476570.diff 1.13 KB

#5

With the latest dev version, I am able to add the blocks in now. BUT, they don't actually display. I tried adding them to 'canvas right' where I have my other blocks.

#6

Status:fixed» closed (fixed)

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

#7

Status:closed (fixed)» needs work

I'm getting the same as george, added just fine but nothing is showing up.

#8

Oh, just looked into the code on this & it has "TODO: support canvas pages, in addition to connect pages." on everything. Since I'm using canvas pages that means me :(

#9

Category:bug report» feature request

Yeah, its a TODO item to support canvas pages. Patches alwas welcome to fix TODOs.

#10

With latest 3.x version, I get I get a blank screen when I enable the friends block.
If I move to a page (like admin) with a different theme for which the block was not enabled, I can see the following warning:
warning: Missing argument 2 for fb_fql_query(), called in /home/webappz/public_html/sites/all/modules/fb/contrib/fb_friend.module on line 129 and defined in /home/webappz/public_html/sites/all/modules/fb/fb.module on line 278.

line 278 of fb.module is:

function fb_fql_query($fb, $query, $params = array()) {
  $params['query'] = $query;
  //$result = fb_call_method($fb, 'fql.query', $params);
  $params['method'] = 'fql.query';
  $result = $fb->api($params);

  return $result;
}

Line 129 of contrib/fb_friend.module is:

$rs = fb_fql_query("SELECT uid FROM user WHERE has_added_app=1 AND uid IN (SELECT uid2 FROM friend WHERE uid1 = $fbu)"); // FQL not SQL, no {curly_brackets}

This is running Drupal 6.16 on Apache MPM worker with PHP 5.3 as fcgi on Ubuntu 10.04 Lucid.

Beta 6.2x worked fine. I did a full uninstall of modules via web interface and removal of files before installing 6.3 dev.

#11

Category:feature request» bug report
Status:needs work» active

#12

Status:active» needs review

all you need to do is add the $_fb to the function call.
So replace in line 129 of contrib/fb_friend.module:
$rs = fb_fql_query("SELECT uid FROM user WHERE has_added_app=1 AND uid IN (SELECT uid2 FROM friend WHERE uid1 = $fbu)"); // FQL not SQL, no {curly_brackets}
with this:
$rs = fb_fql_query($_fb, "SELECT uid FROM user WHERE has_added_app=1 AND uid IN (SELECT uid2 FROM friend WHERE uid1 = $fbu)"); // FQL not SQL, no {curly_brackets}

#13

subscribing

#14

Status:needs review» fixed

This bug is quite old, and I believe fixed already.

#15

Status:fixed» closed (fixed)

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