]> git.nbdom.net Git - nb.git/commitdiff
lib/php/db/field.php
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 20 Sep 2018 10:02:46 +0000 (11:02 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 20 Sep 2018 10:02:46 +0000 (11:02 +0100)
lib/php/db/field.php
lib/php/db/table.php
www/dbq/html/default.js

index d59a621919ecfd549e30b585d66fdc4c55374edf..2c6599702f01869d96428be5ff1fac214b3225e9 100644 (file)
@@ -147,6 +147,9 @@ class field extends nb {
                                # NB 09.02.18: needed ? 
                                if ($tag == 'textarea' and $type != 'text') $tag = 'input';
 
+                               # Trim CHAR type
+                               if (preg_match('/^\s+$/',$value)) $value = '';
+
                                # Html friendly
                                if ($media = Mime::html($value,'',$mime)) {
                                        if ($this->html_edit_hide_min_size
index 29726eb339e84ff333b6c1801d140b2ba1a5f1cc..960e9c354813b772e50a657e904a97d4b4d18dde 100644 (file)
@@ -611,9 +611,6 @@ Class Table extends nb {
 
                        foreach ($this->fields() as $name => $field) {
 
-# NB 08.01.18         if ($add and !preg_match('/^(null|.*\(.*)?$/',strtolower($field->default))) {
-# NB 08.01.18           $row[$name] = $field->default;
-#debug([$name,$row[$name]]);
                                if ($add) {
                                        if (empty($row[$name])) $row[$name] = $field->default2str();
 
index fd29823492b5804fbfabf5eec3206c9c8df6b04e..7138c3cbb53503c5cb6694d2e32243d895d28574 100644 (file)
@@ -1,4 +1,6 @@
 document.addEventListener("DOMContentLoaded", function() {
+       $('.db-rows form.rm').each(function() {
+       });
 
        //console.log('LOADED');
        NodeList.prototype.forEach = Array.prototype.forEach;