Index: trunk/core/kernel/utility/unit_config_reader.php =================================================================== diff -u -r7931 -r7991 --- trunk/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 7931) +++ trunk/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 7991) @@ -391,6 +391,13 @@ } else { $options = $config['Fields'][$f_name]; + $default_missing = false; + if (!array_key_exists('default', $options)) { + $debugger->appendHTML("Config Error: Default value for field $f_name in config for prefix ".$config_link." not set !"); + safeDefine('DBG_RAISE_ON_WARNINGS', 1); + $default_missing = true; + } + if ($field['Null'] != 'YES') { // MySQL5 for null returns "NO", but MySQL4 returns "" if ( $f_name != $config['IDField'] && !isset($options['not_null']) && !isset($options['required']) ) { @@ -402,19 +409,16 @@ safeDefine('DBG_RAISE_ON_WARNINGS', 1); } - if (!isset($options['default'])) { - $debugger->appendHTML("Config Error: Default value for field $f_name in config for prefix ".$config_link." not set !"); - safeDefine('DBG_RAISE_ON_WARNINGS', 1); + if (!$default_missing) { + if ($f_name == $config['IDField'] && $options['default'] !== 0) { + $debugger->appendHTML("Config Error: Default value for field IDField $f_name (".var_export($options['default'], true).") in config for prefix ".$config_link." differs from default value from field in database (".var_export($field['Default'], true).") !"); + safeDefine('DBG_RAISE_ON_WARNINGS', 1); + } + else if ($options['default'] != '#NOW#' && $field['Default'] !== (string)$options['default'] && !in_array($options['type'], $float_types)) { + $debugger->appendHTML("Config Error: Default value for field $f_name (".var_export($options['default'], true).") in config for prefix ".$config_link." differs from default value from field in database (".var_export($field['Default'], true).") !"); + safeDefine('DBG_RAISE_ON_WARNINGS', 1); + } } - elseif ($f_name == $config['IDField'] && $options['default'] !== 0) { - $debugger->appendHTML("Config Error: Default value for field IDField $f_name (".var_export($options['default'], true).") in config for prefix ".$config_link." differs from default value from field in database (".var_export($field['Default'], true).") !"); - safeDefine('DBG_RAISE_ON_WARNINGS', 1); - } - else if ($options['default'] != '#NOW#' && $field['Default'] !== (string)$options['default'] && !in_array($options['type'], $float_types)) { - $debugger->appendHTML("Config Error: Default value for field $f_name (".var_export($options['default'], true).") in config for prefix ".$config_link." differs from default value from field in database (".var_export($field['Default'], true).") !"); -// $debugger->dumpVars($field['Default'], $options['default'], 'STRICT'); - safeDefine('DBG_RAISE_ON_WARNINGS', 1); - } // check that all idfields have default values & are not_null!!! }