Hi,

I wanted to do some quick testing with the module, but when looking at the included fb_example module I realised it mustn't have been ported yet...standby for a patch...

Comments

stevetweeddale’s picture

StatusFileSize
new15.97 KB

Tested myself and it seems fine, but any feedback welcome.

stevetweeddale’s picture

StatusFileSize
new15.95 KB

...and one with no-prefix for those of us using drush_make.

Dave Cohen’s picture

cool, thanks for that!

So, you're recommending the second patch, right? I don't know what "no-prefix" means.

stevetweeddale’s picture

Short answer: first one should be good.

Long answer: The first one was created with git format-patch, and as such should apply nicely with git am, which I believe is the currently recommended format/workflow for patches on d.o - though don't quote me on that.

However, drush make currently chokes on patches made like that, but will work if you pass the --no-prefix option to git format-patch. So I uploaded that second patch with the --no-prefix formatting so that people (...me) can reference the patch here on drupal.org directly in make files.

kanani’s picture

That's funny, I just did a port of the same module cause I needed it for D7. Should have checked the issue queue before I started.

Overall yours looks better Steve but I included the optional file includes (http://drupal.org/node/542202) in the fb_example.info file

files[] = fb_example.install
files[] = fb_example.module

and the correct drupalforfacebook.org spelling in the description column
description = These hooks will make your site behave more like drupalforfacebook.org. Use this code as an example for your own customizations.

stevetweeddale’s picture

Gutted!

As far as I'm aware, the files declarations are for dynamic loading of PHP classes and interfaces only, and as such have no effect in this case - so I left them out, so as to not to contribute to any general confusion about their exact purpose.

rumblewand’s picture

Received the error
DatabaseSchemaObjectExistsException: Table xxxxx already exists. in DatabaseSchema->createTable() (line 623 of http://xxx\xxx\xxx\xxx\includes\database\schema.inc).
On trying to re-enable the custom examples module regarding fb friends table.

Thanks to post #995094: DatabaseSchemaObjectExistsException I read that "probably means that your module is incorrectly calling drupal_install_schema() in its hook_install(). This is not necessary anymore as Drupal is calling this for you automatically."

After deleting lines 12 and 13 of the fb_friend.install that refer to the line above everything seems ok at first glance.

Undead_Woody’s picture

Status: Needs review » Needs work

First try to patch with NetBeans, on the contrib folder (I guess... cannot see further informations about wich other folder could be affected by this patch)

Patching is incomplete after :

# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- C:\dev\sites\all\modules\fb\contrib\fb_example.install.original~
+++ C:\dev\sites\all\modules\fb\contrib\fb_example.install
@@ -6,14 +6,29 @@
  */
 
 
-// Set weight so that fb_example comes after fb_user.
+/**
+ * Implements hook_install().
+ *
+ * Set weight so that fb_example comes after fb_user.
+ */
 function fb_example_install() {
   // So we fall after og_vocab and og
-  db_query("UPDATE {system} SET weight = 3 WHERE name='fb_example'");
+  db_update('system')
+  ->fields(array(
+    'weight' => 3,
+  ))
+  ->condition('name', 'fb_example')
+  ->execute();
 }
 
+/**
+ * Implements hook_update_N().
+ */
 function fb_example_update_1() {
-  $ret = array();
-  $ret[] = update_sql("UPDATE {system} SET weight = 3 WHERE name='fb_example'");
-  return $ret;
+  db_update('system')
+  ->fields(array(
+    'weight' => 3,
+  ))
+  ->condition('name', 'fb_example')
+  ->execute();
 }

On fb_example.install

How to fix this ?
Thanks a lot for your work.

rumblewand’s picture

I had posted too quickly after trying this. It look like more is needed because while I was able to install it, I was unable to see any of the blocks added to my blocks page. I'm afraid it will take some more digging.

Wish I could help you with the patch Undead Woody but I will have to learn a bit more on modules and patching!

Undead_Woody’s picture

Could someone eventually send the successfully patched fb_example files ?

rumblewand’s picture

Got the patch from Steve implemented. Deleted the offending code in the FB_Friends module so that it "seems" to install without throwing the error.

I now see the like button added to nodes *cheers* however no example blocks or additional features showing. No biggie since I'm using social plugins I can implement myself but wanted to report.

mattbk’s picture

Okay, so the D7 example module doesn't work at all in the dev version right now? Would be good to know.

stieglitz’s picture

What is the status of this issue? There have been several updates but still this functionality seems to be missing. I've had trouble with a netbeans patch as well.

franzkewd’s picture

Has anyone got this working? Badly need this feature.

Cheers.

dooug’s picture

Priority: Normal » Major

The fb_example module for 7.x-3.x-dev should not have drupal 6 hooks in it! This really needs to be fixed, bumping up to major priority. The patches above did not apply cleanly on 7.x-3.x-dev for me.

Apparently there was a bounty for this: http://drupal.org/node/1348040 but nothing was contributed from it?

Dave Cohen’s picture

I guess I lost track of this patch when it was new. no longer applies cleanly.

Remember the fb_example module is intended to be snippets that you might use in your own custom hooks. Not actually intended to be enabled on live sites. There's a lot of customization you can control in code, and this module is intended to show how that can be done. It's not meant to do what's appropriate for your particular site whatever that may be.

warmth’s picture

Subscribing...

dooug’s picture

Remember the fb_example module is intended to be snippets that you might use in your own custom hooks. Not actually intended to be enabled on live sites.

If that is the case, Can that be more clear on the project page?

Either way, I don't see any reason for the D7 branch to have D6 hooks.

chrisjlee’s picture

warmth’s picture

@chrisjlee: can you believe I always complain about what I just did? LOL I'm sorry, I think I was in a hurry and didn't think before posting and closing the tab. My bad.

thedavidmeister’s picture

Status: Needs work » Needs review
StatusFileSize
new15.07 KB

The patches did not apply for me. Here is my attempt at a re-roll.

Dave Cohen’s picture

Status: Needs review » Fixed

A belated commit. I can't say I've tested everything in fb_example. If any problems, please submit new issue.

Status: Fixed » Closed (fixed)

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