]> git.nbdom.net Git - nb.git/commitdiff
fix bug in select_extras
authorNicolas Boisselier <nicolas.boisselier@semantico.com>
Mon, 17 Oct 2016 13:34:33 +0000 (14:34 +0100)
committerNicolas Boisselier <nicolas.boisselier@semantico.com>
Mon, 17 Oct 2016 13:34:33 +0000 (14:34 +0100)
lib/php/db/table.php

index 6e4663ee5f8c25e7c5b09b6c0e93728cdbe4e2e8..39af3171ff081919ccf731db34f065a372719526 100644 (file)
@@ -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