Index: branches/unlabeled/unlabeled-1.76.2/core/kernel/utility/unit_config_reader.php
===================================================================
diff -u -r8183 -r8184
--- branches/unlabeled/unlabeled-1.76.2/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 8183)
+++ branches/unlabeled/unlabeled-1.76.2/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 8184)
@@ -354,11 +354,13 @@
$this->ValidateConfig($prefix);
}
}
+
function ValidateConfig($prefix)
{
global $debugger;
$config =& $this->configData[$prefix];
+
$tablename = $config['TableName'];
$float_types = Array ('float', 'double', 'numeric');
$conn =& $this->Application->GetADODBConnection();
@@ -373,6 +375,7 @@
$res = $conn->Query('DESCRIBE '.$tablename);
$config_link = $debugger->getFileLink(FULL_PATH.$this->prefixFiles[$config['Prefix']], 1, $config['Prefix']);
+
$error_messages = Array (
'field_not_found' => 'Field %s exists in the database, but is not defined in config',
'default_missing' => 'Default value for field %s not set in config',
@@ -382,6 +385,7 @@
'invalid_default' => 'Default value for field %s%s not sync. to db (in config = %s, in db = %s)',
'type_missing' => 'Type definition for field %s missing in config',
);
+
$config_errors = Array ();
$tablename = preg_replace('/^'.preg_quote(TABLE_PREFIX, '/').'(.*)/', '\\1', $tablename); // remove table prefix
@@ -393,6 +397,7 @@
// skip multilingual fields
continue;
}
+
if (!array_key_exists ($f_name, $config['Fields'])) {
$config_errors[] = sprintf($error_messages['field_not_found'], $f_name);
}