JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
metaform: fixed SQL for decimal and other weird numeric types
authorJason Woofenden <jason283@herkamire.com>
Thu, 13 Nov 2008 13:29:11 +0000 (08:29 -0500)
committerJason Woofenden <jason283@herkamire.com>
Thu, 13 Nov 2008 13:29:11 +0000 (08:29 -0500)
metaform.php
metaform/template.php

index f7a5740..e9c73ec 100644 (file)
@@ -170,7 +170,7 @@ function make_sql() {
                if($sql != 'n/a') {
                        $tem->set('name', $name);
                        $tem->set('type', $sql);
-                       if($sql == 'int') {
+                       if(substr($sql, 0, 3) == 'int' || substr($sql, 0, 7) == 'decimal') {
                                $tem->set('default', '0');
                        } elseif($format == 'yesno') {
                                $tem->set('default', '"No"');
index a0b657f..7697c48 100644 (file)
@@ -88,6 +88,8 @@ function ~form_name~_main() {
        if($ret) {
                return $ret;
        }
+
+       # sections displayed with tem_show() will be coppied to the main template if you have one.
        tem_show('main_body');
 }