From: Nicolas Boisselier Date: Mon, 17 Oct 2016 13:34:33 +0000 (+0100) Subject: fix bug in select_extras X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=85aa947ab0c265f40ccfa35484e5e6f8422e4b76;p=nb.git fix bug in select_extras --- diff --git a/lib/php/db/table.php b/lib/php/db/table.php index 6e4663ee..39af3171 100644 --- a/lib/php/db/table.php +++ b/lib/php/db/table.php @@ -269,6 +269,10 @@ Class Table extends nb { if (!isset($this->_fields)) { $this->_fields = true; + # Extras fields at the end + $save_fields = $this->fields; + $this->fields = []; + $conf = $this->unvar($this->db()->conf_type('table.fields',true)); if (is_scalar($conf)) $conf = array('sql'=>$conf); $rows = $this->db()->conn->query($conf['sql']); @@ -313,6 +317,8 @@ Class Table extends nb { } + # Extras fields at the end + $this->fields = array_merge($this->fields,$save_fields); #if (empty($this->fields)) bye("Table `".$this->name."` does not exists"); } # < $this->fields