From 025a34dbd54a0886d766f386792310e5f6bfe701 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Fri, 14 Apr 2017 21:01:10 -0400 Subject: Revert "Fix bug in table function saveObj()" This reverts commit e7228676ce51bf69cc974fc0bd8f8135c51fd036. --- app/class/table.class.php | 3 --- 1 file changed, 3 deletions(-) (limited to 'app') diff --git a/app/class/table.class.php b/app/class/table.class.php index c547e43..ac21aaf 100644 --- a/app/class/table.class.php +++ b/app/class/table.class.php @@ -127,10 +127,7 @@ abstract class table foreach ($flds as $fld) { if (!isset($this->$fld)) - { - $this->$fld = ""; continue; - } $fld = database::esc($fld); $fldstr .= $fld . ", "; -- cgit v1.2.3 From 453a2fc20886fa25b94017c1cccdbd05456a2d60 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Fri, 14 Apr 2017 20:50:24 -0400 Subject: Fix bug in table function saveObj() Added call to refreshObj() to the end of function saveObj() to fetch all default values defined by the database, not set on the object in PHP. --- app/class/table.class.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app') diff --git a/app/class/table.class.php b/app/class/table.class.php index ac21aaf..52a3e7d 100644 --- a/app/class/table.class.php +++ b/app/class/table.class.php @@ -142,6 +142,8 @@ abstract class table database::query($query); } } + + $this->refreshObj(); // fetch default, unset values from database } } -- cgit v1.2.3