? cols.patch
Index: mysite.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mysite/mysite.module,v
retrieving revision 1.62
diff -u -p -r1.62 mysite.module
--- mysite.module	9 Sep 2007 21:26:17 -0000	1.62
+++ mysite.module	12 Sep 2007 01:29:12 -0000
@@ -809,6 +809,7 @@ function mysite_prepare_columns($mysite,
   // reset the key to zero if there is only one column
   if (count($data) == 0) {
     sort($data); 
+    $new = $data;
   }
   else {
     // otherwise, slide existing data to a new array and unset the old
@@ -833,23 +834,23 @@ function mysite_prepare_columns($mysite,
     }
   }
   if ($cols > 1) {
-    // this only needs to be checked if the user is looking at his or her own page
-    if (user_access('administer mysite') || (user_access('edit mysite') && $user->uid == $mysite->uid)) {
-      for ($i = 0; $i < $cols; $i++) {
-        if (empty($new[$i])) {
-          $new[$i][0]['title'] = 'Add content';
+    // handles empty regions gracefully
+    for ($i = 0; $i < $cols; $i++) {
+      if (empty($new[$i])) {
+        if (user_access('administer mysite') || (user_access('edit mysite') && $user->uid == $mysite->uid)) {
+          $new[$i][0]['title'] = t('Add content');
           $new[$i][0]['mid'] = NULL;          
           $new[$i][0]['format'] = $mysite->format;
           $new[$i][0]['output']['items'][0]['content'] = theme('mysite_empty_column', $user);
         }
-      }
-    }  
-    $return = $new;
-  }
-  else {
-    $return = $new[0];
+        else {
+          // this should probably be themed
+          $new[$i][0] = array();
+        }
+      }  
+    }
   }
-  return $return;
+  return $new;
 }
 
 /**
