I have made the module work, i can see the fb connect button.
After i click, i get the facebook popup asking me for login, ok. I do login and the facebook popup do close, ok.
After the popup get closed im redirected to /fbconnect/register/prompt...where the node region is empty, i see an empty page.

I did setup the fb xmlsn like this

<html xmlns:fb="http://www.facebook.com/2008/fbml" 
        xmlns="http://www.w3.org/1999/xhtml" 
        xml:lang="<?php print $language->language ?>" 
        lang="<?php print $language->language ?>" 
        dir="<?php print $language->dir ?>">

and my page does have the print $closure at the very end.
Status report seems ok, dblog seems ok, apparently the module is enabled and working.
I am using facebook-php-sdk 2.1.1.

What could be causing this?

Comments

brazorf’s picture

I tried dig a little deeper into this.

The menu item fbconnect/register/prompt is handled by the function fbconnect_prompt_page, defined in fbconnect.pages.inc. This is a very simple function:

/**
 * Menu callback.
 * Called when user perform facebook registration
 */
function fbconnect_prompt_page() {
  $links = fbconnect_prompt_page_links();
  $output = array();
  foreach ($links as $link) {
    array_push($output, theme('box', $link));
  }

  return join("\n", $output);   
}

Now, what i see is that the $output array is empty, print_r($output) shows

Array ( [0] => [1] => ) 

Links are correctly set, so the issue is related to the theme('box') function. I've never used this theme hook, and i cant see any 'box' hook in the fbconnect_theme impl. Where should that be defined?

brazorf’s picture

Component: Miscellaneous » Code

Ok, i found out that theme_box actually is a theme hook defined in includes/theme.inc

function theme_box($title, $content, $region = 'main') {
  $output = '<h2 class="title">'. $title .'</h2><div>'. $content .'</div>';
  return $output;
}

Function fbconnect_prompt_page is invoking this hook passing the $title, but not the $content. I tried

foreach ($links as $link) {
    array_push($output, theme('box', 'test'));
  }

and it didnt work yet. Tried

foreach ($links as $link) {
    array_push($output, theme('box', 'test','test'));
  }

and finally got my page display the output "test test". So this is what's happening.

I really cant figure out why i am the only one facing this issue. I will hack that part of fbconnect code, hoping someone can explain me this matter.

cogniven’s picture

I had a similar issue and probably most won't run into this. We had clean urls turned off so urls need "?q=" to work correctly. I modded the "$url= url('?q=fbconnect/register/prompt');" line in theme_fbconnect_login_button function to add the "?q=". This made it work for me. Not sure why drupal is not transforming the url correctly for clean or dirty urls...

brazorf’s picture

As far as i know the url function is part of the abstraction layer from you and the menu routing system, so you should not use the "?q=", you should use the plain path. Anyway this seems like a different issue. Furthermore, im working with clean urls aswell.