Drupal for Facebook on version 6.x
Dave Cohen - March 17, 2008 - 21:04
| Project: | Drupal for Facebook |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Description
This issue will keep track of progress on the 6.x port.
At this time, I'm working on fixing some issues and adding some user management features to the 5.x version. My plan is to create a DRUPAL-6 branch only after these changes are submitted. These changes are to support some apps that are going live this month. Realistically, I do not expect to work on a 6.x version until April.
However patches are always welcome. So if anyone get DFF running on D6, please submit a patch here. I'll post one as soon as I have it working.

#1
I read a comment stating that we could still using drupal for facebook even though the api is php4, but the module will throw errors. How close is the 6.x drupal for facebook to completion? Is it worth trying to get the 5.x version to work with 6.x?
#2
subscribing.
I'm not 100% sure this is what I need but I hope you can answer me. I'm looking for a way to "share" or post -any- content on my drupal site on the sister facebook group (and livejournal community). From what you have it sounds like this permits you to create an application where members who are facebook addicts can add it and follow your content that way... Would this work for what I am looking for?
#3
It's not perfect, but I have ported a working draft of Drupal for Facebook to 6.x. The attached code installs the same way as 5.x (read the README) and is current with Dave Cohen's CVS commits thru #115258 posted on May 7, 2008. I have fb, fb_app, fb_canvas, fb_devel, fb_form, fb_infinite, and fb_user successfully installed. They co-exist nicely with other modules: auto_nodetitle, coder, devel, globalredirect, pathauto, token, and a custom nodetype of my own.
There are still some significant "known" issues in my 6.x port, but I think most stem from the
custom_url_rewrite()function in fb_settings.inc. In 6.x, that function split intocustom_url_rewrite_inbound()andcustom_url_rewrite_outbound(), and I just don't think I have a broad enough grasp of Drupal yet to trace where it's going wrong. I've gotten the whole project this far, please could some fresh eyes shed some light on this?Bugs I've found and not yet solved:
custom_url_rewrite_inbound()in fb_settings.inc orfb_canvas_form_alter()and helper function_fb_canvas_make_form_action_local()in fb_canvas.module.fb_canvas_process()in fb_canvas.module is not rewriting img tags, namely the fb_fbml logo.png file (array value $output['logo']). Again, could be related tocustom_url_rewrite_(in/out)bound()? Facebook will complain until you uncheck "Logo" in the fb_fbml theme settings.fb_fbml_menu_local_tasks()in template.php is crippled for now to just output blank tabs. It calls the functionmenu_get_active_nontask_item(), which disappeared in 6.x, and I just don't understand the menu_ functions in 6.x enough yet to rewrite this function.I am out of steam troubleshooting this port, and gone for the next week anyway. I wanted to post what I had so far, and I hope my work will help jumpstart a full-fledged 6.x-dev branch.
#4
Brent, thanks very much for this. Any chance you could submit a proper patch? http://drupal.org/patch/create
Sounds like a number of those issues will be fixed when the url rewrite code works. That stuff is quite tricky.
#5
Okee, here's an attempt at patches. Created in TextMate. Let me know how I did. :) Would you prefer them all in one file?
I forgot to mention in my earlier post that I started with a clean install of fb. There might be issues when migrating a 5.x FB app to 6.x. Add that to the list for code-review time.
Only had time today to Diff a few modules today. I wanted to cleanup any whitespace differences so the new code was clear. For now, fb and fb_app, along with the .inc files, fb_session and fb_settings, and the README.txt just for kicks.
(UPDATE 5/15: .patch extensions now instead of .diff.)
#6
Here are the rest. Since I haven't migrated all of the modules yet, one patch wouldn't address an entire fb install. Individual patches for just the components that are done remain the best option for now.
#7
Balord, thank you for the patches. I appreciate it, even though there were some problems. Read up here: http://drupal.org/patch/create, and try to consolidate patches into a single file, as that makes them easier to apply. Several of your patches were "reversed", which my patch program can sometimes detect and handle, sometimes not.
I've attached a consolidated patch, although I have not tested it at all yet.
Also, do not add {brackets} to fql queries. That's a drupal-specific syntax and facebook apis will not handle it.
Again, thanks.
#8
This is still a ways off from actually working.
#9
Minor improvements. Still far from working.
#10
Hmmm - yeah, I looked back and did have a couple of the diffs backwards. I was in an airport trying to get all the whitespace to matchup one-by-one. I'm catching on to the tricks of being an efficient open-source citizen.
I will try for better diffs next time around, hopefully will take some more stabs at the code next week.
#11
Here's an improved patch, but still needing work. I'm posting it here so it's not lost forever. However, this patch is for version 1 of DFF, and I expect the first version for Drupal 6.x to be DFF 2.x. So this patch may never be applied. It's based on the DRUPAL-5 branch (version 1.x for Drupal 5.x)
Version 1.x of DFF is built using the older facebook APIs. Version 2.x is for the newer profile and API.
#12
Subscribing, excellent work :)
How far away do you think a 6.x branch is? I'm itching to start testing this hehe
#13
If you're itching, start testing with the patch above.
I'm not sure when I'll create the 6.x branch. It's a pain to support multiple branches.
#14
subscribing
#15
subscribing
#16
subscribe
#17
subscribing
#18
Hey Dave,
How involved does a deadwood upgrade look to you from the 5.2.x release? I'm sure i could knock out the basics there. Also should we be moving to the PHP5 API exclusively in the 6 release?
Cheers
#19
Subscribing
#20
subscribing
#21
subscribing
#22
subscribe, looking forward to an official dev/beta version for D6
#23
I've been too busy to keep up with the D6 patch. At the time of comment #11, the patch applied cleanly and was mostly functioning. There have been a number of changes to 5.x-2.x-dev since then. I know I'll update the patch sooner or later but recently there's been a lot on my plate.
@TextPlease I'm not sure what you mean by "deadwood upgrade". But I can say that Drupal for Facebook 5.x-2.x is PHP5 only. Largely because the new facebook php api is php5 only.
#24
Here's an updated patch, for the latest Drupal for Facebook 2.x. It is not complete, and has not received a lot of testing, but it's certainly enough to get started on D6. I have a simple test app serving canvas pages with it.
I'm glad to see interest in this thread. Feel free to check out the latest fb modules from CVS, apply this patch and get started on Drupal 6.
#25
Any chance I can get a zipped version (instead of the patch) ? thanks again.
#26
Dave, when do you think 5.x-2.x-dev will be frozen/stabilized as a real release? If more changes are coming, how much is the D6 patch likely to suffer from obsolescence?
#27
I can't say for certain, but my guess is that in January I'll make a D6 branch and from then work mainly with that branch. I'm on vacation the first two weeks of Jan, so probably right after that.
@saokar - you can find instructions on how to use cvs and patch files elsewhere on drupal.org.
#28
subscribe
#29
subscribe
#30
subscribe
#31
subscribing
#32
Subscribing
#33
subscribing
#34
subscribing.
in the meanwhile, must the patch at #24 be used against 5.x-2.x-dev, right?
congrats for your work.
#35
@Antinoo: If you plan to try the patch soon could you post here if it works and/or any code updates?
#36
Got it all from CVS
got redesign-changes from FB svn, modified settings.php
This is what I got "This version is incompatible with the 6.8 version of Drupal core."
probably have to apply the patch =)
I mean I am ready to contribute.
I have experience, my own OS project is here http://digger3d.com/modules.php?name=News&file=article&sid=19
#37
applying the patch was a problem
|RCS file: /cvs/drupal-contrib/contributions/modules/fb/themes/fb_fbml/Attic/styles.tpl.php,v
|retrieving revision 1.9
|diff -u -r1.9 styles.tpl.php
|--- themes/fb_fbml/styles.tpl.php 1 Aug 2008 07:26:20 -0000 1.9
|+++ themes/fb_fbml/styles.tpl.php 1 Dec 2008 20:13:27 -0000
--------------------------
File to patch:
No file found--skip this patch? [n] y
Skipping patch...
Hunk #1 ignored at 1.
Hunk #2 ignored at 215.
2 out of 2 hunks ignored--saving rejects to fb_fbml/styles.tpl.php.rej
Can't create fb_fbml/styles.tpl.php.rej, output is in /tmp//patchr3S0fXZ: No such file or directory
Hmm... The next patch looks like a unified diff to me...
I am hoping it is not critical...
#38
it was not critical... after editing fb_settings.inc it seems to be working, going to disable debug output...
Brilliant job Dave! Thank you very much! Just point me where you need help the most.
#39
following this
#40
subscribing
#41
Just FYI, I'm on vacation till the middle of January. Hope to have an update to this issue near the end of Jan.
#42
+1
#43
looking forward to it
#44
subscribing too
#45
subscribinating
#46
subscribing
#47
Subscribing
#48
Dave,
I haven't had a chance to properly play with this but I watched your screencasts and checked the documentation... It looks GREAT.
So... I have a potential project it would be perfect for coming up in February (if our proposal is given the go-ahead) in which case I would be interested in sponsoring the development of the module and will also be able to help with testing. I'm not a coder so can't help on that front but if you contact me when you're back from hols with an idea of what kind of sponsorship (if any!) would be a help to you get this off the ground (Drupal 6 branch) as soon as possible then please let me know and I may be able to help. For sure once a D6 branch is available I'll help with testing, even if the commercial project doesn't go ahead.
Look forward to hearing from you,
Adam
#49
Just out of interest... is this PAGES and PROFILE compatible?
#50
subscribe
#51
Dave, can you set up Chipin or PayPal so we can help sponsor the changes for D6? Chris
#52
I appreciate the sponsorship offers and I'll set something up next week...
Yes, the modules support adding boxes to pages and profiles. Also news feed messages, etc...
#53
Great. For sure we will make an initial contribution that could be upped if we get the contract I mentioned.
Hope you had a good holiday :)
Adam
#54
I'm using Facebook Auth module for single sign on to our web site.
http://drupal.org/project/facebook_auth
Will this module going to provide a upgrade path so that current user who have associated their Facebook IDs can use it?
Thanks,
=gk
#55
politely subscribing!
#56
Any chance of someone posting an unrolled version of this patch. I've spent the last 5 hours learning how to unroll it, then manually fixing a bunch of errors that occurred for some reason when applying the patch (mostly in the info files), plus the regular set up time. It's still not working. I could normally live with this, since it seems it's not nearly ready for release, but I remain restless because I'm unsure whether it's my patching skills or something other issue!
While I'm at it, I found these things:
- fb_canvas.module was still using $may_cache in a menu hook, which was deprecated in D6. I just removed that argument and that warning went away.
- After updating the settings.php file (as indicated in the README), a bunch of repeats of "fb_settings_url_rewrite_inbound(node, node, )" occurred at the very top of every page. Sometimes "node" was replaced with "calendar" (which I have installed). This seems to have come from a line in fb_settings.inc where the coder tried to provide a replacement for the fact that the function custom_url_rewrite_inbound was dropped in D6. If you search for "function fb_settings_url_rewrite_inbound", you'll see that several lines into it, there is a print command for the exact line that was repeated a bunch at the top of my page. I just commented that one line out. Not sure if this caused problems later... but the garbage went away.
- Finally, once I set up my facebook app page, with basically the same settings as I had in my D5 setup (which worked), I got this error on the facebook application page (which was obviously passed through from drupal):
Fatal error: Unsupported operand types in [ROOT]/includes/common.inc on line 1369
On searching for this error, it appears to have something to do with upgrading to D6.7 or D6.8 (conjectured from this thread: http://drupal.org/node/346756)
So anyway, I might be wrong or way off base in much of this guesswork -- I'm really new to this! But anyway, didn't want these last few hours to be completely for naught, so if it helps anyone else, then great! :)
#57
subscribing :->
#58
I am also anxious to start trying this on 6.8. I hope to apply the patch tonight and see how it goes.
#59
I patched against fb-5.x-2.x-dev and received several errors. My admin/modules area still reported the version as 5.x, so the patch was not successful. What code should this be applied to?
The errors I received are attached for reference.
I am using Drupal 6.8
#60
subscribe
#61
Same errors I received civil. Looking over the error dump files, you can see that it's mostly just updating the info files with the core version and the new format for dependencies (using arrays). Update all those manually by looking at the error dumps. The only odd one out is the feed module file, which messes up in replacing a function, but this can also be fixed manually. Just read my post above when the other errors occur after this. For the record, I'm also using drupal 6.8
#62
Subscribing
#63
Here a re-rolled patch against the latest.
Anyone serious about sponsoring some of this development please contact me. I'll post some details Monday about several tasks that need sponsorship and/or volunteers.
#64
subscribing
#65
Subscribing
#66
Subscribing
#67
Just for information - I'm sure Dave will update soon, but he has put the details for what needs sponsoring on his website - as someone who can't help on the PHP front but hopes to contribute to this fundraising, I'm urging all who have a sincere want to see this development through to see if they can help in any way :)
Here is the link: http://www.dave-cohen.com/node/3033
#68
joining :-)
#69
Subscribing
#70
subscribing
#71
This update fixes some calls to url() which used the outdated set of parameters.
#72
Can we create D6 dev release for more consistent testing?
#73
My plan is to create a D6 branch in the next week or two. From then on all development will be D6 based. But there are still a couple things I want working better in the D5 branch. I don't want to develop on two branches concurrently.
I've just added a fbconnect login block to the D5 branch. I think there are some bugs around logout and account creation. When these are resolved I'll make the cvs HEAD be the D6 version and have a D6 dev release.
#74
does anyone have an all rolled up version of fb-6.x, complete with all these diffs included to save me the hassle?
also, subscribe
#75
subscribe
#76
I've recently checked in a number of improvements to the 5.x branch, including fixes to Facebook Connect login block and related session management issues. Also some support for showing feed dialogs. So, the patch for Drupal 6.x is out of date again. I plan to update it over the weekend, so stay tuned.
If this issue is important to you, please sponsor the project. Most of the development has been my volunteer effort. Although clients have commissioned specific features in the past, I have no client specifically sponsoring the Drupal 6.x port or Facebook Connect features. I'm hoping the community as a whole can contribute towards these features. Thanks for considering it.
#77
Thanks for the time your putting into this project, Dave. I really appreciate it and to show my gratitude I made a small contribution of $20. I wish I could give more, but funds are tight at this point. Hopefully when I establish my start-up I will have enough revenue to support projects like this.
As a side note, the feature I would like most in D6 is displaying 1 line stories in the user's profile feed on facebook when the user performs an action on my drupal site.
#78
subscribe
#79
re-rolled. Still not including some important modules...
#80
Added fb_connect.module, with Facebook Connect login block.
#81
subscribe
#82
I've created a DRUPAL-5--2 branch for Drupal 5.x continued development (bug fixes)
Drupal HEAD is now Drupal 6.x code. Attached is the patch, just for posterity.
This is still a devel release, the views and actions modules are not yet updated. So I'll keep this issue active...
#83
Well, I tried to create a DRUPAL-5--2 branch, and I'm trying to check in the 6.x code to CVS HEAD. But I screwed things up, and I get this error whenever I try:
Message: cvs commit: sticky tag `HEAD' for file `README.txt' is not a branchIf anyone knows what cvs command might get past this problem, please let me know. I want to be able to commit changes to HEAD.
#84
I think I solved the cvs issues. The previous patch file is checked into the HEAD branch. Again, leaving this issue open because there's still work to be done on the 6.x version.
#85
subscribe
#86
I don't think it has been committed. Or at least I am not seeing it on the project page.
#87
It was not on the page until now. I had to check a box on the release admin page here on drupal.org. You should see it now.
#88
Subscribing. You might want to create multiple tickets for each of the tasks for D6 to make it easier for people to help.
Is there any D6 documentation available since I was not able to achieve anything except having facebook connect to drupal and giving me the error
FBML Error (line 23): illegal tag "body" under "fb:canvas"which means it probably got the front page with the normal theme in stead of the fb_fbml theme (which is activated)?#89
By all means, anyone with an issue should submit a new one. This issue is not closed because the actions and views modules are not yet ported to D6. So I don't consider this work complete.
The D6 version is usable. Although no one will get very far without reading the README.txt. Just because its long does not mean it should be skipped.
I've checked in a number of improvements to the D5 branch this week. Will port them to D6 over the next few days...
#90
Well, I've read the README. The troubleshooting for the issue I am having says to lower the weight for fb.module. Here's the relevant output of the system table:
mysql> select name, weight from system order by weight limit 5;+----------------------+--------+
| name | weight |
+----------------------+--------+
| fb | -2 |
| content_profile | -1 |
| fb_fbml | 0 |
| imageapi_gd | 0 |
| imageapi_imagemagick | 0 |
+----------------------+--------+
But I see settings.inc checks for
$_GET['q']for a key but when facebook calls my URL it's a POST. Anyway, this is becoming a support post and this is not the right place for that. My guess is that I'm inputting an incorrectCanvas Callback URLand I can't seem to find what it should be in the docs.#91
Any progress on porting the views and actions modules?
I might start looking into porting those myself - but not sure how much time it'll take yet.
#92
Hey, I have not upgraded them. And I won't, until I have a pressing need, which hasn't happened yet, obviously.
I'd appreciate you taking a stab at it. Personally I think the views module is more important. There's really only one argument handler in there. I just haven't had time to learn the new views API.
#93
subscribing
#94
subscribing
#95
subscribing
#96
Is my understanding correct that without actions for D6 there is no posting of nodes to facebook?
Also it seems like there is not any other module that will do this, is this also true?
#97
You'll probably want to take a look at this thread. It looks like the way that publishing to facebook is handled is changing.
http://drupal.org/node/447610
Hope that helps. I was able to get it working on my site: http://www.ournewspaperarchive.com - it is only visible to facebook users.
Sean
#98
subscribing
#99
@pyrello, how did you get it working on your site? Some step-by-step instructions can help here.
#100
Sure.
That's it. Your node and comment forms should now have a checkbox with "share to facebook" after it that is defaulted to checked. When the user saves the post, it triggers a pop-up that prompts them to publish it to facebook too. I added the following css class to my checkbox, which adds a little facebook favicon next to it to pretty it up a little bit:
.fb_icon {background:transparent url(http://static.ak.connect.facebook.com/images/connect_favicon.png) no-repeat scroll left center;
padding-left:20px;
}
Hope that helps!
And a question for the maintainter: Dave, is it necessary if you are providing the pop-up prompt to enable extended permissions for writing to the stream, or is that only for if you are going to do it without prompting them?
#101
I understand that extended permission is only necessary if you want to write to the stream without prompting them. Let's keep that discussion in the other thread, though.
Regarding Drupal for Facebook on D6, the code is quite stable right now. I've moved some files into fb/contrib (implying less reliability/support) while modules in fb/ are Drupal for Facebook's "core". I will remove some obsolete code, then call it a beta release. So if you haven't updated your Drupal for Facebook in a while, I recommend doing it now, even though the version number has not yet changed.
#102
@pyrello, many thanks.
Dave, should this not be a part of fb_stream? with a UI to configure the templates?
#103
hi pyrello. i followed the instructions you gave, nothing shows up on the nodes like at dff.o
the module is enabled, just added a dependency line on fb... are there other dependencies this would have that aren't listed?
all modules are current, core fb modules are enabled.
what else can you note that would make this work?
#104
fb_actions 6.x-2.0-beta2 still declares a dependency on actions. This makes it difficult to enable this module on a Drupal 6 site ;-).
If this module is cutt off on purpose then a note in fb_actions.info would be great... Thanks in advance.
#105
fb_actions 6.x-2.0-beta2 still declares a dependency on actions. This makes it difficult to enable this module on a Drupal 6 site ;-).
If this module is cutt off on purpose then a note in fb_actions.info would be great... Thanks in advance.
#106
subscribing
#107
subscribing