From: Devops Date: Tue, 30 May 2017 11:09:01 +0000 (+0100) Subject: fix bug for extras X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=da17179a4f50c59175df2a61e4a2fe82f6e195ba;p=nb.git fix bug for extras --- diff --git a/lib/php/db/table.php b/lib/php/db/table.php index bfa963e3..1041a255 100644 --- a/lib/php/db/table.php +++ b/lib/php/db/table.php @@ -752,6 +752,8 @@ Class Table extends nb { # having, denorm, EMPTY if ($field->extras) { $extra_where = (string)$this->db()->conf_type('extra_where'); + #if ($_SERVER['REMOTE_USER'] == 'nico') debug($sql); + $k = $field->extras; if ($extra_where == 'having') { $having[] = "$k$equal$v"; } else { @@ -772,10 +774,6 @@ Class Table extends nb { public function add_extras($extras) { if ($this->p('extras') === '0') return false; - #return false; - - # Test if type exists because of a bug from shell.php -# NB 30.08.16 if ($this->db()->conf_type('type')) $this->fields(); foreach ($extras as $k => $v) { @@ -1903,7 +1901,7 @@ Class Table extends nb { public function err_sql($sql) { $err = $this->db()->conn->errorInfo(); $err[] = $sql; - self::bye(join(' | ',$err)); + $this->bye(join(' | ',$err)); } public function html_menu($opt=[]) {