MDL-29612 xmldb editor - fix recent regression + prevent unsigned floats and numbers
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Sat, 1 Oct 2011 23:18:32 +0000 (01:18 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Sat, 1 Oct 2011 23:18:32 +0000 (01:18 +0200)
admin/tool/xmldb/actions/edit_field/edit_field.js

index 0ad9133..d241042 100644 (file)
@@ -86,13 +86,17 @@ function transformForm(event) {
         case '2':  // XMLDB_TYPE_NUMBER
             lengthTip.innerHTML = ' 1...20';
             decimalsTip.innerHTML = ' 0...length or empty';
+            unsignedField.disabled = true;
+            unsignedField.value = '0';
             break;
         case '3':  // XMLDB_TYPE_FLOAT
             lengthTip.innerHTML = ' 1...20 or empty';
             decimalsTip.innerHTML = ' 0...length or empty';
+            unsignedField.disabled = true;
+            unsignedField.value = '0';
             break;
         case '4':  // XMLDB_TYPE_CHAR
-            lengthTip.innerHTML = ' 1...'.xmldb_field::CHAR_MAX_LENGTH;
+            lengthTip.innerHTML = ' 1...1333'; // Harcoded, yes!
             decimalsTip.innerHTML = '';
             decimalsField.disabled = true;
             decimalsField.value = '';