From 85aa947ab0c265f40ccfa35484e5e6f8422e4b76 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Mon, 17 Oct 2016 14:34:33 +0100 Subject: [PATCH] fix bug in select_extras --- lib/php/db/table.php | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- 2.47.3