From d17648689b467932903679a0aa93aefb2f283218 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Thu, 20 Sep 2018 11:02:46 +0100 Subject: [PATCH] lib/php/db/field.php --- lib/php/db/field.php | 3 +++ lib/php/db/table.php | 3 --- www/dbq/html/default.js | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/php/db/field.php b/lib/php/db/field.php index d59a6219..2c659970 100644 --- a/lib/php/db/field.php +++ b/lib/php/db/field.php @@ -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 diff --git a/lib/php/db/table.php b/lib/php/db/table.php index 29726eb3..960e9c35 100644 --- a/lib/php/db/table.php +++ b/lib/php/db/table.php @@ -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(); diff --git a/www/dbq/html/default.js b/www/dbq/html/default.js index fd298234..7138c3cb 100644 --- a/www/dbq/html/default.js +++ b/www/dbq/html/default.js @@ -1,4 +1,6 @@ document.addEventListener("DOMContentLoaded", function() { + $('.db-rows form.rm').each(function() { + }); //console.log('LOADED'); NodeList.prototype.forEach = Array.prototype.forEach; -- 2.47.3