? bio-author-field-214068-1.patch
? bio-delete-patch-174507-22.patch
? bio-delete-user-174507-24.patch
? bio-fix-bio-install-213211-1.patch
? bio-get-type-214063-1.patch
? bio-inc-cleanup-213217-1.patch
? bio-module-cleanup-213228-1.patch
? blah.patch
? bllerfgssas.patch
? tests/bio.test.txt
Index: README.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/bio/README.txt,v
retrieving revision 1.2.6.2
diff -u -p -r1.2.6.2 README.txt
--- README.txt	26 May 2007 00:06:47 -0000	1.2.6.2
+++ README.txt	28 Jan 2008 07:07:24 -0000
@@ -9,7 +9,7 @@ The bio module is a simple custom node-t
 1) Unless a user has "administer nodes" permissions, he or she can only create *one* bio entry.
 2) Any content that a user creates will receive a link to their bio entry.
 
-The module does not use any custom fields and does not require installation of any database tables.
+The module does not use any custom fields. It installs one small database table for associating bio nodes with user ids.
 
 When configuring a site using this module, I recommend either:
 a) going to admin/build/themes/settings and disabling the "Display post information on" checkboxes
Index: bio.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/bio/bio.install,v
retrieving revision 1.1.2.3
diff -u -p -r1.1.2.3 bio.install
--- bio.install	23 Jan 2008 07:32:13 -0000	1.1.2.3
+++ bio.install	28 Jan 2008 07:07:24 -0000
@@ -7,6 +7,34 @@
  */
 
 /**
+ * Implementation of hook_install().
+ */
+function bio_install() {
+  switch ($GLOBALS['db_type']) {
+    case 'mysql':
+    case 'mysqli':
+      db_query("CREATE TABLE {bio} (
+        nid int unsigned NOT NULL default '0',
+        uid int unsigned NOT NULL default '0',
+        PRIMARY KEY (nid, uid)
+      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+      break;
+    case 'pgsql':
+      db_query("CREATE TABLE {bio} (
+        nid int_unsigned NOT NULL default '0',
+        uid int_unsigned NOT NULL default '0',
+        PRIMARY KEY (nid, uid)
+      )");
+      break;
+  }
+}
+
+/**
+ * @defgroup bio-updates-legacy Bio updates for versions prior to 5.x-1.x
+ * @{
+ */
+
+/**
  * 4.7.x -> 5.x upgrade.
  */
 function bio_update_1() {
@@ -29,6 +57,54 @@ function bio_update_1() {
 }
 
 /**
+ * @} End of "defgroup bio-updates-legacy"
+ */
+
+/**
+ * @defgroup bio-updates-5.x-1.x Bio updates for 5.x-1.x
+ * @{
+ */
+
+/**
+ * Creates and populates a table to hold uid/nid combination.
+ *
+ * Workaround for node_user's annoying behaviour of anonymizing bio nodes
+ * which prevents us from deleting them. 
+ */
+function bio_update_5100() {
+  $ret = array();
+
+  // Create bio table.
+  switch ($GLOBALS['db_type']) {
+    case 'mysql':
+    case 'mysqli':
+      $ret[] = update_sql("CREATE TABLE {bio} (
+        nid int unsigned NOT NULL default '0',
+        uid int unsigned NOT NULL default '0',
+        PRIMARY KEY (nid, uid)
+      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+      break;
+    case 'pgsql':
+      $ret[] = update_sql("CREATE TABLE {bio} (
+        nid int_unsigned NOT NULL default '0',
+        uid int_unsigned NOT NULL default '0',
+        PRIMARY KEY (nid, uid)
+      )");
+      break;
+  }
+
+  // Populate table.
+  $type = db_escape_string(variable_get('bio_nodetype', 'bio'));
+  $ret[] = update_sql("INSERT INTO {bio} SELECT nid, uid FROM {node} WHERE type = '$type' AND uid != 0");
+
+  return $ret;
+}
+
+/**
+ * @} End of "defgroup bio-updates-5.x-1.x"
+ */
+
+/**
  * Implementation of hook_uninstall().
  */
 function bio_uninstall() {
Index: bio.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/bio/bio.module,v
retrieving revision 1.2.2.23
diff -u -p -r1.2.2.23 bio.module
--- bio.module	26 Jan 2008 00:40:55 -0000	1.2.2.23
+++ bio.module	28 Jan 2008 07:07:24 -0000
@@ -239,6 +239,16 @@ function bio_nodeapi(&$node, $op, $a3 = 
         form_set_error('name', t('This user already has a @bio. Edit it <a href="@link">here</a> or assign this entry to another user.', array('@bio' => node_get_types('name', $node), '@link' => url('node/'. $nid .'/edit'))));
       }
       break;
+    case 'insert':
+      // Record user's bio in bio table.
+      db_query('INSERT INTO {bio} (nid, uid) VALUES (%d, %d)', $node->nid, $node->uid);
+      break;
+    case 'delete':
+      // Remove the user's entry from the bio table when the user is deleted.
+      db_query('DELETE FROM {bio} where nid = %d', $node->nid);
+      break;
+
+
   }
 }
 
@@ -254,6 +264,10 @@ function bio_user($op, &$edit, &$account
       if (!$nid = bio_for_user($account->uid)) return;
       if (!node_access('view', $node = node_load($nid))) return;
       return array(node_get_types('name', bio_get_type()) => array('bio' => array('value' => node_view($node, FALSE, TRUE, FALSE))));
+      break;
+    case 'delete':
+      node_delete(bio_for_user($account->uid));
+      break;
   }
 }
 
@@ -292,7 +306,8 @@ function bio_for_user($uid = NULL) {
     global $user;
     $uid = $user->uid;
   }
-  return db_result(db_query("SELECT nid FROM {node} WHERE uid = %d AND type = '%s'", $uid, bio_get_type()));
+
+  return db_result(db_query('SELECT nid FROM {bio} WHERE uid = %d', $uid));
 }
 
 /**
