From 5f26d3a1b8aaedccf6e6889c3052b0b1c378f622 Mon Sep 17 00:00:00 2001 From: Alessandro Frangioni Date: Tue, 28 Jun 2016 10:25:39 +0200 Subject: [PATCH] Added support for binary foreign keys selection on edit --- plugins/edit-foreign.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/edit-foreign.php b/plugins/edit-foreign.php index 4b78c43c..0bb825a2 100644 --- a/plugins/edit-foreign.php +++ b/plugins/edit-foreign.php @@ -26,7 +26,11 @@ class AdminerEditForeign { $id = $foreignKey["target"][0]; $options = &$values[$target][$id]; if (!$options) { - $options = array("" => "") + get_vals("SELECT " . idf_escape($id) . " FROM " . table($target) . " ORDER BY 1"); + $column = idf_escape($id); + if (preg_match('~binary~', $field["type"])) { + $column = "HEX($column)"; + } + $options = array("" => "") + get_vals("SELECT $column FROM " . table($target) . " ORDER BY 1"); if ($this->_limit && count($options) - 1 > $this->_limit) { return; } -- 2.39.5