]> git.joonet.de Git - adminer.git/commitdiff
Fix field selection in Elasticsearch
authorPeter Knut <peter@pematon.com>
Sun, 25 Aug 2024 20:14:35 +0000 (22:14 +0200)
committerJakub Vrana <jakub@vrana.cz>
Wed, 19 Feb 2025 10:16:36 +0000 (11:16 +0100)
Thanks to cweiske: https://github.com/adminerevo/adminerevo/pull/159

plugins/drivers/elastic.php
plugins/drivers/elastic5.php

index 8d450ad07f9db8be9e7fabf2e61054f14ef7bdf5..cf4b17f255bd5c610b6ff2ec6e557335950d26c6 100644 (file)
@@ -133,7 +133,7 @@ if (isset($_GET["elastic"])) {
                function select($table, $select, $where, $group, $order = array(), $limit = 1, $page = 0, $print = false) {
                        $data = array();
                        if ($select != array("*")) {
-                               $data["fields"] = $select;
+                               $data["fields"] = array_values($select);
                        }
 
                        if ($order) {
index 62283226d5f07c3aa65bda59314c00ad52de6cc5..1ad0cb27296d8c6b476febee88d9ca0ae8f7a8c6 100644 (file)
@@ -121,7 +121,7 @@ if (isset($_GET["elastic5"])) {
                function select($table, $select, $where, $group, $order = array(), $limit = 1, $page = 0, $print = false) {
                        $data = array();
                        if ($select != array("*")) {
-                               $data["fields"] = $select;
+                               $data["fields"] = array_values($select);
                        }
 
                        if ($order) {