? corner.patch
Index: corner.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/corner/corner.install,v
retrieving revision 1.4.2.1
diff -u -p -r1.4.2.1 corner.install
--- corner.install	6 May 2009 12:21:29 -0000	1.4.2.1
+++ corner.install	31 May 2009 21:37:06 -0000
@@ -15,9 +15,13 @@ function corner_install() {
   // TODO: is this the correct way to check if install is successful?
   if ($result[0]['success']) {
     // Insert an example corner
-    $sql = "INSERT INTO {corners} (name, image, image_title, image_uri, status, roles, visibility, pages, options)";
-    $sql .= " VALUES ('%s', '%s', '%s', '%s', %d, '%s', %d, '%s', '%s')";
-    db_query($sql, 'Drupal love', 'drupal-love-right.png', 'I love Drupal!', 'http://drupal.org', 0, '', 0, '', 'a:4:{s:8:"location";s:9:"top-right";s:8:"position";s:5:"fixed";s:15:"image_map_shape";s:7:"polygon";s:16:"image_map_coords";s:23:"0,0,150,150,150,95,55,0";}');
+    $example = new stdClass;
+    $example->name = 'Drupal love';
+    $example->image = 'drupal-love-right.png';
+    $example->image_title = 'I love Drupal!';
+    $example->image_uri = 'http://drupal.org';
+    $example->options =  serialize(array('location' => 'top-right', 'position' => 'fixed', 'image_map_shape' => 'polygon', 'image_map_coords' => '0,0,150,150,150,95,55,0', 'image_link_rel' => '', 'image_link_target' => ''));
+    drupal_write_record('corners', $example);
   }
 }
 
Index: corner.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/corner/corner.module,v
retrieving revision 1.5.2.1
diff -u -p -r1.5.2.1 corner.module
--- corner.module	12 May 2009 09:39:14 -0000	1.5.2.1
+++ corner.module	31 May 2009 21:37:06 -0000
@@ -364,22 +364,24 @@ function corner_load_options($corner) {
  * Get the default values of a new corner
  */
 function corner_get_default() {
-  $default = new stdClass();
+  $default = new stdClass;
   $default->cid = 0;
+  $default->status = 1;
   $default->name = '';
   $default->image = '';
   $default->image_title = '';
   $default->image_uri = '';
   $default->image_link_rel = '';
   $default->image_link_target = '';
-  $default->status = 1;
+  $default->image_map_shape = '';
+  $default->image_map_coords = '';
   $default->languages = '';
   $default->roles = '';
   $default->visibility = 0;
   $default->pages = '';
   $default->location = 0;
   $default->position = 0;
-  return (object) $default;
+  return $default;
 }
 
 /**
