Hey everyone,

With the beta release of Drupal 7 right around the corner, I wanted to see if anyone had begun planning of a Drupal 7 port. Our shop has mostly shifted to Drupal 7 development and I 'm interested to learn if any work has begun on D7....

Thanks,
Ben

CommentFileSizeAuthor
#165 picture-preset-795128-165.patch480 bytesdoka
#154 more-bug-fixes-795128-153.patch40.15 KBjagermonster
#153 more-bug-fixes-795128-153.patch39.56 KBjagermonster
#152 fbconnect.zip40.99 KBjagermonster
#151 fbconnect.pages_.inc_.patch1.34 KBjagermonster
#145 795128-README-update-145.patch1.33 KBjagermonster
#144 795128-Port_fbconnect_to_d7-144.patch36.53 KBjagermonster
#143 795128-Port_fbconnect_to_d7-143.patch36.53 KBjagermonster
#142 795128-Port_fbconnect_to_d7-142.patch35.73 KBpcambra
#123 fbconnect.zip46.79 KBjagermonster
#120 port-to-d7-795128-120.patch33.03 KBjagermonster
#119 fbconnect.zip46.64 KBjagermonster
#118 port-for-d7-795128-117.patch28.51 KBjagermonster
#117 port-for-d7-795128-116.patch28.55 KBjagermonster
#116 port-for-d7-795128-116.patch28.55 KBjagermonster
#114 fbconnect-795128-114.patch19.83 KBjagermonster
#112 fbconnect_patched_795128-111.zip53.43 KBAdibou
#111 fbconnect_drupal7_port-795128-111.patch33.84 KBmikeprinsloo
#109 795128-fbconnect-drupal7-2.patch33.87 KBblackdog
#108 795128-fbconnect-drupal7.patch36.03 KBblackdog
#88 Drupal7_further_fixes_795128-88.patch63.71 KBmikgreen
#85 Drupal7_port_fix-795128-85.patch30.85 KBmikgreen
#80 fbconnect.zip41.62 KBmikgreen
#75 remove_hook_footer-795128-00.patch1.11 KBAnonymous (not verified)
#72 footer_update.patch1.91 KBnarayanis
#68 fbconnect-795128-68.patch79.84 KBstevetweeddale
#41 fbconnect-795128-41.patch80.99 KBtim.plunkett
#40 fbconnect-795128-40-whitespace.patch43.01 KBtim.plunkett
#40 fbconnect-795128-40.patch81 KBtim.plunkett

Comments

johngriffin’s picture

tracking

vectoroc’s picture

Status: Active » Postponed

I've created 7.x branch in github, but I did'nt test it. Fbconnect module should be rewritten cause a lot of changes in FB API

johngriffin’s picture

Cheek’s picture

subscribing

BenK’s picture

Hi vectoroc,

Thanks for the update. Since you brought up the topic of Facebook API changes, I thought it would be useful to start a discussion of what specific changes need to be incorporated into the module. As I understand it, there are three new aspects to the Facebook API:

1. Social Plugins: Enables developers to easily add user interaction to web pages (e.g., a “Like” button) using an

or a combination of XFBML and FaceBook’s JavaScript SDK. 2. The Open Graph Protocol: Content can be linked with one or more users, across different parts of their profiles, including profile pages, activity streams, news feeds, and even search results. Currently the protocol is implemented by adding several tags to the of a web page. 3. The Graph API: Access to various data objects has been streamlined (https://graph.facebook.com/username). Were you thinking about incorporating these changes or something different? Thanks, Ben
BenK’s picture

@johngriffin: Actually, I think the repo that vectoroc is referring to is here:

http://github.com/vectoroc/fbconnect/tree/7.x

@vetoroc: Are there any maintenance/refactoring tasks that need to be done to the 6.x branch before proceeding with more active development on the 7.x branch?

--Ben

langworthy’s picture

@vectoroc I've forked your repo and have started a little work. As mentioned in my first pull request on github i'm pretty new to github collaboration so please go easy on me. Thanks.

langworthy’s picture

I was planning on giving a little help getting a module to 7 but I see in http://drupal.org/node/788118 that the 6.x of this needs some love. I'll be working on that for the time being.

ryan.armstrong’s picture

Would be great to have a D7 version, but I agree, getting the 6x some love is a good idea

vectoroc’s picture

BenK: I think that new fb api does not belong to facebook connect (and this module). Only things that should be done before D7 porting is bug fixing...

vectoroc’s picture

BenK: I think that new fb api does not belong to facebook connect (and this module). Only things that should be done before D7 porting is bug fixing...
#788118: This module needs to be updated

Cheek’s picture

Any update? Would be great to have this ready for the first D7 beta..

willmoy’s picture

Issue tags: +D7 porting

Tag and sub

nunof’s picture

subscribing

zandros’s picture

subscribing

gordon’s picture

subscribe

shaynl’s picture

any news about D7 version?

mainpc’s picture

duplicate post (feel free to delete)

mainpc’s picture

subscribing

ramper’s picture

Subscribing

roam2345’s picture

Subscribing

itsmarc’s picture

subscribing

jeffl8n’s picture

subscribing

int’s picture

+1

Smenzo’s picture

subscribing

blackspiraldancer’s picture

subscribing, too

gvc’s picture

waiting for this module in D7..

dropbydrop’s picture

any news?
is there any other module or alternative way to do the same job?

kinshuksunil’s picture

subscribing

davividal’s picture

@vectoroc: I've just forked your repo on github. How can I help in order to port this module to D7?

Thanks

nunof’s picture

subscribing

ConradFlashback’s picture

subscribing

vectoroc’s picture

@davividal: see 7.x branch. but porting is'nt started yet
btw this branch is outdated a bit

chevy’s picture

subscribing

negatifo’s picture

subscribing

discursives’s picture

+1 subscribe

hello@melmcdougall.com’s picture

subscribing

pixelsweatshop’s picture

sub

tim.plunkett’s picture

Title: Drupal 7 port... » Drupal 7 port of fbconnect
Version: » 6.x-2.x-dev
Assigned: Unassigned » tim.plunkett
Category: support » task
Status: Postponed » Active

I'm working on this actively. I will post a link to my github fork soon.

tim.plunkett’s picture

Status: Active » Needs review
StatusFileSize
new81 KB
new43.01 KB

Github was way out of date.

One patch ignores all whitespace changes, for easier readability.

Mostly changes to function signatures, and to DBTNG.

tim.plunkett’s picture

StatusFileSize
new80.99 KB

Was missing a parenthesis. That's what I get for uploading the patch before testing.

venkatd’s picture

I am really in need of a D7 version of fbconnect. Let me know if I can be of any help.

I am new to the Facebook API and I've just started using D7 but I'm not new to PHP or Drupal.

tim.plunkett’s picture

Assigned: tim.plunkett » Unassigned
vectoroc’s picture

@tim.plunkett: github version was most up to date (if I got correctly your thoughts)
I will review your patch as soon as I can

SilviaT’s picture

subscribe

vectoroc’s picture

@tim.plunkett: in what order do I apply your patches? or just last one?

tim.plunkett’s picture

Just the last one, to a CVS chectkout of DRUPAL-6--2.

physicalpatrick’s picture

subscribed

achton’s picture

subscribing

n20’s picture

subscribing

eugene_z’s picture

subscribing

KirstenLangholz’s picture

subscribing

mthart’s picture

subscribing

MrVictor’s picture

subscribing

Anonymous’s picture

subscribing

likewhoa’s picture

Title: Drupal 7 port of fbconnect » Port to Drupal 7

subscribing

tim.plunkett’s picture

Title: Port to Drupal 7 » Port Facebook Connect to Drupal 7

Instead of just subscribing, how about someone review the patch in #41?

Also, keeping the module name in the issue makes it easier to discern in the tracker.

jennifermontes’s picture

I tried the patch and it's not really working for me. For an anonymous user that's not logged in to the site, I get the following notices:

    * Notice: Undefined index: theme path in theme() (line 789 of /Users/jen/Sites/drupal7/includes/theme.inc).
    * Notice: Trying to get property of non-object in fbconnect_theme_user_picture_override() (line 814 of /Users/jen/Sites/drupal7/sites/all/modules/fbconnect/fbconnect.module).
    * Warning: Attempt to assign property of non-object in fbconnect_theme_user_picture_override() (line 815 of /Users/jen/Sites/drupal7/sites/all/modules/fbconnect/fbconnect.module).
    * Warning: Attempt to assign property of non-object in fbconnect_theme_user_picture_override() (line 816 of /Users/jen/Sites/drupal7/sites/all/modules/fbconnect/fbconnect.module).
    * Notice: Trying to get property of non-object in fbconnect_theme_user_picture_override() (line 819 of /Users/jen/Sites/drupal7/sites/all/modules/fbconnect/fbconnect.module).
    * Notice: Trying to get property of non-object in fbconnect_theme_user_picture_override() (line 820 of /Users/jen/Sites/drupal7/sites/all/modules/fbconnect/fbconnect.module).
    * Notice: Undefined variable: closure in include() (line 20 of /Users/jen/Sites/drupal7/sites/all/themes/framework/html.tpl.php).

The last notice, "Undefined variable: closure", is probably caused by adding print $closure to the end of my template as per the instructions in the README.

The module inserted the following HTML into my login block, but no actual active link:

<div class="form-item form-type-item" id="fbconnect_button">
    <div class="description">Sign in using Facebook</div>
</div>

I used patch #41 on the dev version of the Facebook Connect module, and the module is on a clean install of drupal on my local machine. The Application ID and Application Secret were set and the XFBML tags were in place in the html tag at the top of my template. The only thing I'm having doubts about is the "Connect URL" because the settings page never displayed one... I just guessed and used the URL for the root of my site.

mchelen’s picture

subscribing

scthomps312’s picture

subscribing

Duck Whistle’s picture

subscribing

BenK’s picture

For those who need a module right away to integrate with Facebook on Drupal 7, you should check out the Janrain Engage module (http://drupal.org/project/rpx). There's already been one stable release for D7 and the development of new features is proceeding very quickly.

The Janrain Engage module supports integration with Facebook, Twitter, Myspace, Google, Yahoo!, and many other identity providers. (Currently, 18 different social networks and service providers are supported.) You can also choose to just use the Facebook integration features if you prefer.

The great thing about the module is that both authentication (logging in) and social sharing (posting content back to your social network) is supported if you enable those features.

Cheers,
Ben

philberndt’s picture

Status: Needs review » Needs work

subscribing

ryne.andal’s picture

subscribing

itspriyank’s picture

subscribing

h4ck3rm1k3’s picture

Subscribing, will start to help test or write tests on a part time basis.

kidsil’s picture

subscribing

stevetweeddale’s picture

Status: Needs work » Needs review
StatusFileSize
new79.84 KB

Re-rolled the patch in #41 against the current 6.x-2.x branch head for further testing. Not done any testing myself though...

vectoroc’s picture

commited to the 7.x-2.x branch

danimatielo’s picture

Hello,

I've installed the 7.x-2.x dev version on my site and followed all the instructions (which also must be updated for a formal release of the module: the html tag, referred on the step 6 of the readme.txt, is not defined on page.tpl.php anymore: now it is defined on html.tpl.php, which can be found in the system folder).

Still, I could not make the module work: I get the same errors as #58. I've tried changing the theme, but still couldn't solve it. Any ideas of what could be happening?

Thank you in advance,

dmadruga’s picture

subscribing

narayanis’s picture

StatusFileSize
new1.91 KB

I ran the module through Coder and saw that it still implements hook_footer(), which is deprecated for D7. I tried to convert it to hook_page_alter() per the D7 requirements. Attached is my first patch contribution to a Drupal module; please be gentle!

stevetweeddale’s picture

Version: 7.x-2.x-dev » 6.x-2.x-dev

Good catch! Sorry I missed that. I'd recommend using git to create patches if you can - it's the future! The full system file paths at the top of your patch file are preferred to be relative paths to the project root - using the git workflow means you don't have to think about it.

Also, not totally sure, but I'd have thought it's worth looking into using drupal_add_js to add the js instead of hook_page_alter...there's a scope parameter that allows you to say it should be placed with the other footer javascript. sorry I've not time to work on the patch!

stevetweeddale’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev
Anonymous’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev
StatusFileSize
new1.11 KB

#72 @narayanis I would keep the $footer array variable in the function, and not escape out parts of the script.

Then implode the script into the $page[page_bottom] variable at the end of the function.

Patch attached, includes workaround for D7 to render the auto connect form as well.

Anonymous’s picture

Regarding the D7 readme.txt:

  6. In order for the user's browser to correctly recognize XFBML tags, you need to specify that the page is in XHTML. 
    Edit the "page.tpl.php" file of your current theme. edit the <html> tag and add the facebook xmlns for rendering XFBML.
    
    Example : <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 ?>">

In D7 themes there is no <html> tag in the page.tpl.php anymore, Drupal provides it from core. So how to update that html?

tike012’s picture

The tag should be in html.tpl.php, I believe.

Anonymous’s picture

Re: #76

In Drupal 7, there is a new hook called hook_rdf_namespaces which is perfect for inserting the required facebook attribute.

Something like this will do the trick and remove the need for people to manually edit template files:


/**
 * Implements hook_rdf_namespaces().
 * Add xmlns:fb="http://www.facebook.com/2008/fbml" attribute to html tag.
 */
function fbconnect_rdf_namespaces() {
  return array(
    'fb' => 'http://www.facebook.com/2008/fbml',
  );
}

Loving some of the new hooks in D7 :)

kirie’s picture

Thank you everybody for your great work on getting this ported to 7 - much appreciated! Like #70 I'm also, unfortunately, not able to get it to work. I also used ausrick's excellent suggestion from #78 and verified that the correct rdf namespace does indeed render correctly.

mikgreen’s picture

StatusFileSize
new41.62 KB

Here's a working version. I'm sure there are some bugs still, but basic functionality works fine.

Anonymous’s picture

@#80 a patch file would be useful to establish what changes you have implemented from the current dev :)

wwwcitizen’s picture

Using the last module from #80 I got :

Error
The website encountered an unexpected error. Please try again later.
Error message

    Notice: Undefined index: email in fbconnect_register_page() (line 95 of /home/dev/drupal-7.0/sites/all/modules/fbconnect/fbconnect.pages.inc).
    You must enter an e-mail address.
    Recoverable fatal error: Argument 1 passed to drupal_http_build_query() must be an array, string given, called in /home/dev/drupal-7.0/includes/common.inc on line 2157 and defined in drupal_http_build_query() (line 473 of /home/dev/drupal-7.0/includes/common.inc).
mikgreen’s picture

@ausrick give me a hint how to make a patch for whole module, e.g. multiple files. I'm too lazy to figure it out now. ;)

Anonymous’s picture

@mikgreen, git (http://git-scm.com/) is the best way to go and what Drupal uses for version control, so worth researching.

Follow the instructions at http://drupal.org/project/fbconnect/git-instructions to set up your local repository of the current dev. Then swap the files with your changed versions and prepare a patch following the instructions on the same page.

The result will be a patch of all the differences! :)

mikgreen’s picture

StatusFileSize
new30.85 KB

@ausrick, thanks! I've created as clean a patch as possible. JS file is not changed that much, it's a big part of patch because of whitespace indentation.

Known issues:
- If you log out of Facebook (in other window), then refresh Drupal page a couple of times, fbconnect settings will lose connection information and ask again to login with Facebook to link your account (even though it is still linked in database). Somehow D6 version of fbconnect manages to keep that facebook session even if you log out of Facebook.
- Of creating account, fbconnect settings (fb_visible, fb_avatar) are not saved.
- If you choose to use fb avatar as your user image, user profile form still allows to upload image (pointless).
- Why store fbuid in both database mapping table and user object (second is redundant)?

sanyatuning’s picture

subscribing

sanyatuning’s picture

Hi all.

I don't see "Connect URL" in my settings screen, i found just a label, but value isn't there.
The connect button on User edit page do nothing.

Could you help me?

mikgreen’s picture

StatusFileSize
new63.71 KB

Another version. Two first issues from #85 have been fixed.

jackhutton’s picture

subscribing.

urbanfarmer’s picture

subscribing

kirie’s picture

Hey mikgreen - thanks for your work on this! I tried your extensive patch from #88, and could finally get it working! Thanks!!

Some misc feedback:

Settings pages:
On the settings page (admin/config/fbconnect) - the field "Connect url" is empty, and looking at the code (around line 62 in fbconnect.admin.inc) the form element "#type" is "item" and uses "#value" instead of "#markup" for displaying of the info (which resulted in nothing begin displayed).

On the "Apperance page" the setting "Disable linking accounts during registration" doesn't seem to do anything

The page at "admin/config/fbconnect/fb-app" is completely empty

User account FB settings page (user/UID/edit/fbconnect):
There's a link there to the "User settings" page - the whole thing should probably be removed if profile pics are disabled on the site

Again, thanks a lot for your work - its really appreciated!

KirstenLangholz’s picture

... and for the noobs ....

Would it be possible to provide a new 7.x-2.x-dev version with all the patches included, so it is easier for me to update it?

Thanks in advance..

itaces’s picture

I second KirstenLangholz's post.

I am not having success patching the fbconnect 7.x-2.x-dev posted by vectoroc on March 16, 2011 at 4:56pm, and this module is really valuable to D7 sites, being that it's might more lightweight than Drupal for Facebook which is much more of a beast.

I've gotten the Drupal7_port_fix-795128-85.patch to work using:
patch -p1 -b < Drupal7_port_fix-795128-85.patch (no error messages)

But, I get errors with Drupal7_further_fixes_795128-88.patch file.

And, I'm probably not qualified to contribute to the development process, but here goes:

On line 124 of "fbconnect.pages.inc", there's an invalid function, "db_result" (D6 function replaced with fetchField() in D7), is used... shouldn't line 124 be:

$result = db_query($query, $name_suggestion)->fetchField();
AdrianB’s picture

Subscribing.

andrebonfanti’s picture

subscribe

sorensong’s picture

+1

robato’s picture

For those who have successfully patched this file, could you post the working module somewhere on the internet for those of us that keep getting failed hunk messages?

Every single patch file in this thread gives me fail notices with the most recent version of the module.

cwsmith1701’s picture

Notice: Trying to get property of non-object in fbconnect_user_identities() (line 174 of /home/content/46/7809246/html/sites/all/modules/fbconnect/fbconnect.pages.inc).

I'm getting this as I try to connect facebook to a preexisting account. Don't know if this bug needs to be addressed or if it's already been addressed currently.

d.holmen@gmail.com’s picture

Subscribing

Bahlool’s picture

subscribing

walterswa’s picture

subscribing

syodash’s picture

subscribing

felipepodesta’s picture

+1
subscribing

MacRonin’s picture

+1 subscribe
Keeping an eye out

rlmumford’s picture

*deleted*

geerlingguy’s picture

subscribe

matthiashansal’s picture

subscribe

blackdog’s picture

StatusFileSize
new36.03 KB

Here's a re-roll of #88.

Changes since #88:

Fixed the #markup form fields on the settings pages and moved the settings to config/people/fbconnect.
I'm not sure about all the JS changes, since they are all from mikgreens patch in #88.

Problems I'm seeing:

Can't create new account - email address isn't fetched.

blackdog’s picture

StatusFileSize
new33.87 KB

Better patch that also fixes the issue with getting the email address.

aspilicious’s picture

Status: Needs review » Needs work

Patch is full of tabs and traling whitespaces

mikeprinsloo’s picture

Status: Needs work » Needs review
StatusFileSize
new33.84 KB

Removed tabs and trailing white spaces.

Adibou’s picture

Assigned: Unassigned » Adibou
StatusFileSize
new53.43 KB

Hi, I have patched fbconnect with the patch of #111 for peoples who don't use "GIT".
It work for me.

Version patchée avec le patch du #111 pour les personnes n'utilisant pas "GIT".
Fonctionnel.
Good look.

likewhoa’s picture

Assigned: Adibou » Unassigned

patch applies cleanly. @Adibou unless you plan to maintain this, you shouldn't assign yourself to this bug as it requires further testing before a RTBC

jagermonster’s picture

StatusFileSize
new19.83 KB

I have been doing some work on this module to get it working.

narayanis’s picture

Do these patches ever get rolled into the dev build? There are a lot in this thread now and it may make sense to push them and work from latest.

jagermonster’s picture

StatusFileSize
new28.55 KB

I have been doing some more work on this module to get it working. navigate to fbconnect/register/prompt
to give it a test
This patch is to be applied to the 7.x-2.x head and includes the previous patch

jagermonster’s picture

StatusFileSize
new28.55 KB

I have been doing some more work on this module to get it working. navigate to fbconnect/register/prompt
to give it a test
This patch is to be applied to the 7.x-2.x head and includes the previous patch

jagermonster’s picture

StatusFileSize
new28.51 KB

Oops wrong patch on previous post (it contains some bugs) please use this one

jagermonster’s picture

StatusFileSize
new46.64 KB

Zip file with patch applied for people without git.

jagermonster’s picture

StatusFileSize
new33.03 KB

Been doing some more to get this working on drupal 7. The facebook api that is being used is v2.1.1 this will need to be updated some time since v3 has been released. Put facebook.php v2.1.1 in the fbconnect module directory directly so it is available at fbconnect/facebook.php
Module now allows users to log into website using facebook, also allows users to link account on facebook with account on website.
find latest patch attached. This patch includes all patches and will need to be applied to the 7.x-2.x trunk

bnicoll’s picture

Hi Jagermonster,

Is there a difference in the last patch and the zip file you posted a few hours earlier.

I'm still experiencing errors on connect and also the error:

Notice: Use of undefined constant BLOCK_NO_CACHE - assumed 'BLOCK_NO_CACHE' in fbconnect_invite_block_info() (line 66 of /var/www/vhosts/mysite.com/httpdocs/sites/all/modules/fbconnect/fbconnect_invite/fbconnect_invite.module).

Be great if we can get this running.

Appreciate your work
B.

Anonymous’s picture

Many thanks for sharing your work on this, jagermonster.

7.x-2.x with patch at #120 working here with facebook.php v2.1.2. I only tested the basic auth functionality.

jagermonster’s picture

StatusFileSize
new46.79 KB

bnicoll at #121 yes this latest patch has some fixes mostly javascript fixes. i have attached a zip file, the facebook.php library is in the zip file.

bnicoll’s picture

Thanks jagermonster,

I've ditched it for the time being and going to try using the janrain/rpx module as suggested in post #62.

Thanks
Ben.

jagermonster’s picture

great, just needed something functional for the time being.

Ashu’s picture

hi jagermonster,
I have used your given zip module in #123.with that many of the issues are solved.But on the login page
the fbconnect button is not still present.Please help...
Thanx in Advance.

bochen87’s picture

Also the takeover of the facebook profile picture doesn't work :-(

jagermonster’s picture

yes i know, only login and account creation.
will see if i get some more time i might have a look at the picture support

jagermonster’s picture

#126 Ashu if you would like to add a link to the registration form use the hook_form_alter function to add it to the registration/login form
here is an example
/**
* Implements hook_form_alter().
*/
function YOUR_MODULE_NAME_form_alter(&$form, &$form_state, $form_id){
//add facebook login button to login form
if($form_id == 'user_register_form' || $form_id == 'user_login' || $form_id == 'user_login_block'){
//get facebook info
$conf = fbconnect_get_config();
//check if facebook api key and secret is set
if(!empty($conf)){
$reg_msg = t('Log in with Facebook');
$reg_attr = array();
if ($conf['fast_reg_mode']) {
$reg_attr = array('attributes' => array(
'onclick' => 'Drupal.fbconnect.DoFastRegistration(this); return false;'
));
}
$form['fb_login'] = array(
'#prefix' => '

',
'#markup' => l($reg_msg,'fbconnect/register/create',$reg_attr),
'#suffix' => '

',
);
}else{
drupal_set_message('Facebook api key and secret not set');
}
}
}

damienmckenna’s picture

damienmckenna’s picture

This might be a slightly more sane version of _facebook_client_load_include() and would waste much less effort doing file checking:

function _facebook_client_load_include() {
  // TODO: add full Libraries API support.
  if (!class_exists('Facebook')) {
    $paths = array(
      DRUPAL_ROOT . '/sites/all/libraries/facebook',
      dirname("__FILE__"),
    );
    foreach ($paths as $path) {
      $path .= '/facebook.php';
      if (file_exists($path)) {
        include $path;
        break;
      }
      else {
        watchdog('fbconnect', t("Unable to load the required Facebook library, please check the README.txt for instructions on how to resolve this."));
      }
    }
  }

  return class_exists('Facebook') && defined('Facebook::VERSION');
}
damienmckenna’s picture

Slight fix for the code in #131 that doesn't leave a watchdog message just because the file doesn't exist in sites/all/libraries. Also, the correct check is dirname(__FILE__), not dirname("__FILE__").

function _facebook_client_load_include() {
  // TODO: add full Libraries API support.
  if (!class_exists('Facebook')) {
    $paths = array(
      DRUPAL_ROOT . '/sites/all/libraries/facebook',
      dirname(__FILE__),
    );
    foreach ($paths as $path) {
      $path .= '/facebook.php';
      if (file_exists($path)) {
        include $path;
        break;
      }
    }
    if (!class_exists('Facebook')) {
      watchdog('fbconnect', t("Unable to load the required Facebook library, please check the README.txt for instructions on how to resolve this."));
    }
  }

  return class_exists('Facebook') && defined('Facebook::VERSION');
}
damienmckenna’s picture

It might be worth adding a link on the API settings page to the API registration page, e.g.:

function fbconnect_api_keys_settings($form, &$form_state) {
  $form['fbconnect_appid'] = array(
    '#type' => 'textfield',
    '#required' => TRUE,
    '#title' => t('Application ID'),
    '#default_value' => variable_get('fbconnect_appid', NULL),
    '#description' => t('Also called the <em>OAuth client_id</em> value on Facebook App settings pages. <a href="https://www.facebook.com/developers/createapp.php">Facebook Apps must first be created</a> before they can be added here.'),
  );

  $form['fbconnect_skey'] = array(
    '#type' => 'textfield',
    '#required' => TRUE,
    '#title' => t('Application Secret'),
    '#default_value' => variable_get('fbconnect_skey', NULL),
    '#description' => t('Also called the <em>OAuth client_secret</em> value on Facebook App settings pages.'),
  );

I also included the "OAuth" field names, to help site builders identify what strings to add where.

damienmckenna’s picture

Missing feature:

  • Connecting Facebook accounts to existing user accounts (user/$uid/edit/fbconnect).

Some existing code is there, presumably from the 6.x branch, but it's commented out.

Ashu’s picture

thanx jagermonster for replying...
But i have done that on the same day Using This Patch

@@ -214,7 +222,7 @@ function fbconnect_form_alter(&$form, $form_state, $form_id) {

// Render fbconnect on login block.
case 'user_login_block':
- if (!empty($_GET['destination']) && ($_GET['destination'] != 'fbconnect/link') && facebook_client()) {
+ if ( ((!isset($_GET['destination']))||($_GET['destination'] != 'fbconnect/link')) && facebook_client()) {

#848354 : ask user for email permission when account linking is disabled
$attr = array();
@@ -225,8 +233,8 @@ function fbconnect_form_alter(&$form, $form_state, $form_id) {
$form['fbconnect_button'] = array(
'#type' => 'item',
'#description' => t('Sign in using Facebook'),
- '#value' => fbconnect_render_button($attr),
- '#weight' => 1,
+ '#markup' => fbconnect_render_button($attr),
+ '#weight' => 200,
'#id' => 'fbconnect_button',
);
}

mudtraining’s picture

Subscribing.

pcambra’s picture

As there is a D7 release for this module already published, shouldn't we treat the individual issues/improvements separately?

filip.baeke@gmail.com’s picture

Hi, I'm having the same problem as mentioned in #98
Notice: Trying to get property of non-object in fbconnect_user_identities() (line 174 of /home/content/46/7809246/html/sites/all/modules/fbconnect/fbconnect.pages.inc).

Did anyone find a solution ?

mudtraining’s picture

Is anyone getting this after #129 and #135?

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table '.users' doesn't exist: SELECT COUNT(name) FROM users WHERE name = ':user_name'; Array ( [user_name] => ) in _fbconnect_get_username() (line 123 of ......sites/all/modules/fbconnect/fbconnect.pages.inc).

It seems like the answers are here in some form, a release would be so money. If a new release is provided, I'd be happy to test it out. (I'm not able to do any solid development yet.)

ktleow’s picture

Subscribe

jagermonster’s picture

responce to #98 and #138, i created an account on the drupal site. then navigated to user/#uid/edit/fbconnect and used the fbconnect to connect my account with facebook. It worked fine. Try using the module attached to #123 and let me know if you still get the error and the exact steps you used.

pcambra’s picture

StatusFileSize
new35.73 KB

Here's a patch with the changes suggested by Damien and also some fixes for stream module.

jagermonster’s picture

StatusFileSize
new36.53 KB

I have fixed the facebook profile picture support.
This patch includes 795128-Port_fbconnect_to_d7-142.patch and all previous ones by me on this page.

jagermonster’s picture

StatusFileSize
new36.53 KB

Updated the README
This patch is applied to the 7.x-2.x-dev branch and includes all patches on this page

jagermonster’s picture

StatusFileSize
new1.33 KB

Readme.txt update patch

rlnorthcutt’s picture

subscribe - thanks for everyone's contributions!

cjs_’s picture

What is the status of this?

I tried applying the patch in #144, a few of the attempts fail, but seemingly just for already present corrections.

However, site will not load after, b/c of error:

Call to a member function getSession() on a non-object in .../sites/all/modules/fbconnect/fbconnect.module on line 407

This isn't the typical getSession() error (using the correct 2.x version of the facebook php libs). It only occurs after applying the patch in #144.

Does anyone have this module in working condition under D7?

cjs_’s picture

Okay, applying the later patches to the official 7.x-2.x-dev doesn't seem to work.

This is because one of the above patches moves the expected location of facebook.php, so either be prepared to move it into fbconnect/.

Grabbing the version in #123 gets fbconnect back up and running, but still doesn't seem to work, although it's the most fully working copy yet. Everything seems ready to go, except I never get prompted to authorize the app, and I'm not seeing a login button provided anywhere. Something still isn't complete, but I'm not sure whay.

Dead end again, for now.

bobooon’s picture

The appropriate facebook SDK to use is here, https://raw.github.com/facebook/php-sdk/v2.1.2/src/facebook.php. Put this in sites/all/libraries/facebook/facebook.php and it should rid the getSession error.

ciscoweb01’s picture

Exception thrown while using admin_setAppProperties : The method you are calling must be called with an app secret signed session
Notice: Undefined variable: res in fbconnect_fbapp_settings_submit() (line 289 of /modules/fbconnect/fbconnect.admin.inc).
Checking your facebook session, you are not allowed to change this application settings

This is my error, any clue?

jagermonster’s picture

StatusFileSize
new1.34 KB

Patch to fix an issue with users that have an account on the website and then afterwards try to create an account with fbconnect. Will have to manually apply this patch i did not create it with git

jagermonster’s picture

StatusFileSize
new40.99 KB

Ignore previous patch!! That solution dont work.
Find attached my latest version of the fbconnect module in zip format.
very busy atm will create patch when i have some free time.

jagermonster’s picture

StatusFileSize
new39.56 KB

Patch with all my changes and bug fixes from the current 7.x-2.x dev branch.

jagermonster’s picture

StatusFileSize
new40.15 KB

Last patch contained a bit of custom code
//remove fblogin button
unset($form['actions']['fb_login']);

that should not be in the module
this is the correct patch.

RaulOne’s picture

Hi jagermonster,

When i enable the new fbconnect.zip you uploaded i get this.

Fatal error: Call to a member function getSession() on a non-object in /home/juegosp1/public_html/xxxxx.com.ar/sites/all/modules/fbconnect/fbconnect.module on line 434

Someone know what is/i'm doing wrong? Any idea? The entire site stop working. Work again only after deleting the module.

RaulOne’s picture

Disabled some other facebook modules and working now

jagermonster’s picture

@RaulOne #155 - what version of facebook.php are you using? You have to use the version 2.1.1 or 2.1.2 facebook.php not the Facebook PHP SDK (v.3.1.1)

tgriswold’s picture

I have gotten past most of the errors (or at least I think I have), the last big hurdle was making sure the facebook.php was in the fbconnect directory and not in the src directory. At that point, (after clearing cashe) I got an “invalid URL” message when trying to connect to fb; the App ID and Secret code were correct. To get past this I had to go to My Apps on Facebook and set “Remove Deprecated Auth Methods” to disabled. This can be found under Edit Settings, Advanced migrations. After again clearing cashe and giving Facebook a few minutes to propagate the change, it linked up and I was able to log in using fb and set my picture from fb.

I am still getting a Notice: Undefined variable: preset in fbconnect_theme_user_picture_override() (line 889 … but I was able to log in using FB and link my FB picture. Progress but so painfully slow.

tgriswold’s picture

Installed the version of fbconnect_4 from #152 on a clean D7 install.
Installed facebook.php from SDK 2.1.2 in the fbconnect directory.
Completed the html mod to the modules/system/html.tpl.php file ... it was moved from the theme templates/html.tpl.php file in D7
Set up a facebook app and added the ID and secret key to my fbconnect installation
After the "invalid URL" error (see #158 above), I set “Remove Deprecated Auth Methods” to "disabled" in fb my app
At this point I was able to link to fb and upload my fb image to my drupal account but continue to I get the following error:
Notice: Undefined variable: preset in fbconnect_theme_user_picture_override() (line 889 of /home/----------- /sites/all/modules/fbconnect/fbconnect.module).
I get this error when I added a blog to my test account and it shows 3 times when i view "My Account".
The image does show.

Donaldd’s picture

subscribing

narayanis’s picture

The error in #158 and #159 seems pretty literal. I don't think the $preset variable is being set by either of those if statements. In D7, should an empty variable be "" or NULL? Line 869 is checking if it's set, but may not be doing it the right way. I checked a couple other modules' code and they're all checking for NULLs when doing this kind of thing.

I haven't learned Git yet so I can't roll a patch, but a test to see if that's the cause is to change line 869 (of the version from #152) to this:

elseif (variable_get('fbconnect_pic_size', NULL)) {

neskenazi’s picture

'scribing

narayanis’s picture

Anyone have rights to commit patches? It would be good to get #154 committed so we can keep moving forward, and make it a bit less confusing to follow the thread. The last dev release was in March according to the project page...

MyNameIsCarl’s picture

Suscribing.

And hoping to get it working on my windows/easyPhp box.

Is fbconnect.zip attached to post 152 the definitive plugin to use, or do I have to apply the patch in post 154 on top of the zip.
I know it sounds fetchy but I can't get the whole thing working on my box, and I want to be sure.

Cheers

doka’s picture

StatusFileSize
new480 bytes

It is either/or. So either take the zip of #152 (http://drupal.org/files/issues/fbconnect_4.zip), or download the 7.x-2.x-dev version from March (http://ftp.drupal.org/files/projects/fbconnect-7.x-2.x-dev.tar.gz) and apply the patch of #154 (http://drupal.org/files/issues/more-bug-fixes-795128-153_0.patch) on it.

But for both cases you need an extra patch on fbconnect.module, to overcome the issues of #158 and #159, :

change the line 867 of fbconnect.module from that one:

elseif (variable_get('fbconnect_pic_size', '')) {

to that:

else {

or apply my patch attached.

And you have to use an old Facebook PHP SDK (2.1.2: https://github.com/facebook/php-sdk/tarball/v2.1.2), not the recent ones: download, untar it to /site/all/libraries, rename it to facebook-php-sdk, and copy/symlink the scr/facebook.php into your fbconnect module directory.

yogendrarampuria’s picture

subscribing

drwierdo’s picture

Why aren't the patches commited??

doka’s picture

I've setup a mirror at github for the 7.x-2.x branch, see: https://github.com/doka/fbconnect

The "drupal.org" tag reflects the last committed version of the 7.x-2.x branch, from here, at d.o.
The "7.x-2.x-alpha1" tag is the patched version of jagermonster at http://drupal.org/node/795128#comment-4817546
The "7.x-2.x-alpha2" tag contains a few patches of mine, on top of 7.x-2.x-alpha1, see changelog for more details. This is the last status working fine for me.

I'm happy to accept patches and pull request over there, as long as the 7.x-2.x" branch is not maintained here at d.o.

tim.plunkett’s picture

I've opened #1263774: Offering to comaintain Facebook Connect in the hopes I can start committing this patch and further fixes, to avoid splintering over to github.

tim.plunkett’s picture

Status: Needs review » Fixed

I committed according to the instructions in #165, and then followed up with a coding standards fix. I'm closing this issue, if there are any further bugs, open new issues.

http://drupalcode.org/project/fbconnect.git/commit/7910e9d
http://drupalcode.org/project/fbconnect.git/commit/379a2ba

Status: Fixed » Closed (fixed)

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

hadi farnoud’s picture

I still have problem
Notice: Undefined index: email in fbconnect_register_page() (line 97 of /home/iraniansociety/public_html/sites/all/modules/fbconnect/fbconnect.pages.inc

jagermonster’s picture

file your issue as a bug report in a new thread under 7.x-2.x-dev

onegenius’s picture

subscribing

mareks’s picture

I get the same error on /admin/config/people/fbconnect/fb-app

* The configuration options have been saved.

* Exception thrown while using admin_setAppProperties : This method must be called with an app access_token.

* Notice: Undefined variable: res in fbconnect_fbapp_settings_submit() (line 298 of /var/www/MYSITE/html/sites/all/modules/fbconnect/fbconnect.admin.inc).

* Checking your facebook session, you are not allowed to change this application settings

lennyaspen’s picture

same issue as #176 comment above