From 0f483a2d200f0be49e302f3e2bcf2aa7220a4526 Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Tue, 24 Apr 2018 10:04:51 +0900 Subject: [PATCH] description for session/log id define, better error check for no pk id PK ID return check if not set is checked correctly in normal execute The SET_SESSION_NAME and LOG_FILE_ID get commented out in settings as they should be rather set per file or in header --- www/admin/class_test.php | 6 +++--- www/lib/CoreLibs/DB/IO.inc | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/www/admin/class_test.php b/www/admin/class_test.php index 0f63fec4..db0d64c2 100644 --- a/www/admin/class_test.php +++ b/www/admin/class_test.php @@ -10,16 +10,16 @@ if ($DEBUG_ALL) { ob_start(); +// basic class test file define('USE_DATABASE', true); // sample config require("config.inc"); // set session name DEFINE('SET_SESSION_NAME', EDIT_SESSION_NAME); -// basic class test file -// set language for l10n -$lang = 'en_utf8'; // define log file id DEFINE('LOG_FILE_ID', 'classTest'); +// set language for l10n +$lang = 'en_utf8'; // init login & backend class $login = new CoreLibs\ACL\Login($DB_CONFIG[LOGIN_DB], $lang); $basic = new CoreLibs\Admin\Backend($DB_CONFIG[MAIN_DB], $lang); diff --git a/www/lib/CoreLibs/DB/IO.inc b/www/lib/CoreLibs/DB/IO.inc index 69e75d95..0faf340b 100644 --- a/www/lib/CoreLibs/DB/IO.inc +++ b/www/lib/CoreLibs/DB/IO.inc @@ -1497,7 +1497,7 @@ class IO extends \CoreLibs\Basic } elseif ($this->insert_id[0][$this->prepare_cursor[$stm_name]['pk_name']]) { $this->insert_id = $this->insert_id[0][$this->prepare_cursor[$stm_name]['pk_name']]; } - } else { + } elseif (count($this->insert_id) == 0) { // failed to get insert id $this->insert_id = ''; $this->warning_id = 33;