From bb3d2957e1227fc8ea484e2af1a5a2a7471b73c5 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Sun, 15 Jul 2018 20:37:47 +0200 Subject: [PATCH] Fix function change with set data type (thanks to osoba hrdelnata) --- adminer/static/functions.js | 26 ++++++++++++++------------ changes.txt | 1 + 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/adminer/static/functions.js b/adminer/static/functions.js index ce2dddbf..c34b1cf9 100644 --- a/adminer/static/functions.js +++ b/adminer/static/functions.js @@ -540,20 +540,22 @@ function editingKeydown(event) { */ function functionChange() { var input = this.form[this.name.replace(/^function/, 'fields')]; - if (selectValue(this)) { - if (input.origType === undefined) { - input.origType = input.type; - input.origMaxLength = input.getAttribute('data-maxlength'); - } - input.removeAttribute('data-maxlength'); - input.type = 'text'; - } else if (input.origType) { - input.type = input.origType; - if (input.origMaxLength >= 0) { - input.setAttribute('data-maxlength', input.origMaxLength); + if (input) { // undefined with the set data type + if (selectValue(this)) { + if (input.origType === undefined) { + input.origType = input.type; + input.origMaxLength = input.getAttribute('data-maxlength'); + } + input.removeAttribute('data-maxlength'); + input.type = 'text'; + } else if (input.origType) { + input.type = input.origType; + if (input.origMaxLength >= 0) { + input.setAttribute('data-maxlength', input.origMaxLength); + } } + oninput({target: input}); } - oninput({target: input}); helpClose(); } diff --git a/changes.txt b/changes.txt index 38fd81eb..baa2a887 100644 --- a/changes.txt +++ b/changes.txt @@ -1,6 +1,7 @@ Adminer 4.6.4-dev: Fix inline editing of empty cells (regression from 4.6.3) Allow adding more than two indexes and forign key columns at a time (regression from 4.4.0) +Fix function change with set data type Adminer 4.6.3 (released 2018-06-28): Disallow using password-less databases