From e7228676ce51bf69cc974fc0bd8f8135c51fd036 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Thu, 13 Apr 2017 23:23:56 -0400 Subject: Fix bug in table function saveObj() While creating new objects, some default values (defined in the database schema) are missing in the PHP object definition. To address this, now while saving any *new* database objects, all undefined, expected fields are set to the empty string "". --- app/class/table.class.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'app/class') diff --git a/app/class/table.class.php b/app/class/table.class.php index ac21aaf..c547e43 100644 --- a/app/class/table.class.php +++ b/app/class/table.class.php @@ -127,7 +127,10 @@ abstract class table foreach ($flds as $fld) { if (!isset($this->$fld)) + { + $this->$fld = ""; continue; + } $fld = database::esc($fld); $fldstr .= $fld . ", "; -- cgit v1.2.3