Index: branches/unlabeled/unlabeled-1.76.2/core/kernel/utility/unit_config_reader.php
===================================================================
diff -u -r8121 -r8183
--- branches/unlabeled/unlabeled-1.76.2/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 8121)
+++ branches/unlabeled/unlabeled-1.76.2/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 8183)
@@ -357,6 +357,7 @@
function ValidateConfig($prefix)
{
global $debugger;
+
$config =& $this->configData[$prefix];
$tablename = $config['TableName'];
$float_types = Array ('float', 'double', 'numeric');
@@ -369,6 +370,7 @@
safeDefine('DBG_RAISE_ON_WARNINGS', 1);
return ;
}
+
$res = $conn->Query('DESCRIBE '.$tablename);
$config_link = $debugger->getFileLink(FULL_PATH.$this->prefixFiles[$config['Prefix']], 1, $config['Prefix']);
$error_messages = Array (
@@ -405,6 +407,7 @@
$config_errors[] = sprintf($error_messages['default_missing'], $f_name);
$default_missing = true;
}
+
if ($field['Null'] != 'YES') {
// field is NOT NULL in database (MySQL5 for null returns "NO", but MySQL4 returns "")
if ( $f_name != $config['IDField'] && !isset($options['not_null']) && !isset($options['required']) ) {
@@ -419,9 +422,11 @@
$config_errors[] = sprintf($error_messages['not_null_error3'], $f_name);
}
}
+
if (!array_key_exists('type', $options)) {
$config_errors[] = sprintf($error_messages['type_missing'], $f_name);
}
+
if (!$default_missing) {
if ($f_name == $config['IDField'] && $options['type'] != 'string' && $options['default'] !== 0) {
$config_errors[] = sprintf($error_messages['invalid_default'], 'IDField ', $f_name, $this->varDump($options['default']), $this->varDump($field['Default']));
@@ -433,9 +438,11 @@
}
}
}
+
if ($config_errors) {
$error_prefix = 'Config Error'.(count($config_errors) > 1 ? 's' : '').': for prefix '.$config_link.' ('.$tablename.') in unit config:
';
$config_errors = $error_prefix.' '.implode('
', $config_errors);
+
$debugger->appendHTML($config_errors);
safeDefine('DBG_RAISE_ON_WARNINGS', 1);
}
@@ -444,7 +451,6 @@
function varDump($value)
{
return ''.var_export($value, true).' of '.gettype($value);
-
}
function ProcessDependencies($prefix)