]> git.joonet.de Git - adminer.git/commitdiff
Fix function change with set data type (thanks to osoba hrdelnata)
authorJakub Vrana <jakub@vrana.cz>
Sun, 15 Jul 2018 18:37:47 +0000 (20:37 +0200)
committerJakub Vrana <jakub@vrana.cz>
Sun, 15 Jul 2018 18:37:47 +0000 (20:37 +0200)
adminer/static/functions.js
changes.txt

index ce2dddbf59e24ce0cdb5ab6a4a2ea2a1e02ef852..c34b1cf934945175c2d680a3a45087989a8b6361 100644 (file)
@@ -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();
 }
 
index 38fd81ebf9d6ed1e8902e267e97d6c75acb5d3bd..baa2a8870c3afabe7296c115660633984aee7188 100644 (file)
@@ -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