+ if (isset($config['ParentPrefix']) && $hook['HookToPrefix'] == $config['ParentPrefix']) {
+ trigger_error('Depricated Hook Usage [prefix: <b>'.$config['Prefix'].'</b>; do_prefix: <b>'.$hook['DoPrefix'].'</b>] use <b>#PARENT#</b> and <b>HookToPrefix</b> value where HookToPrefix is same as ParentPrefix', E_USER_NOTICE);
}
- }
-
- $hooks = getArrayValue($config, 'Hooks');
- if (is_array($hooks) && count($hooks) > 0) {
- foreach ($hooks as $hook) {
- if (isset($config['ParentPrefix']) && $hook['HookToPrefix'] == $config['ParentPrefix']) {
- trigger_error('Depricated Hook Usage [prefix: <b>'.$config['Prefix'].'</b>; do_prefix: <b>'.$hook['DoPrefix'].'</b>] use <b>#PARENT#</b> and <b>HookToPrefix</b> value where HookToPrefix is same as ParentPrefix', E_USER_NOTICE);
- }
- if ($hook['HookToPrefix'] == '') {
- $hook['HookToPrefix'] = $config['Prefix']; // new: set hooktoprefix to current prefix if not set
- }
+ if ($hook['HookToPrefix'] == '') {
+ $hook['HookToPrefix'] = $config['Prefix']; // new: set hooktoprefix to current prefix if not set
+ }
- if (isset($config['ParentPrefix']) && $hook['HookToPrefix'] == '#PARENT#') {
- // new: allow to set hook to parent prefix what ever it is
- if ( !array_key_exists ($f_name, $config['Fields']) ) {
- $debugger->appendHTML("<b class='debug_error'>Config Warning: </b>Field $f_name exists in the database, but is not defined in config file for prefix <b>".$config['Prefix']."</b>!");
- $debugger->appendHTML("<b class='debug_error'>Config Error: </b>Field $f_name in config for prefix <b>".$config['Prefix']."</b> is NOT NULL in the database, but is not configured as not_null or required!");
- safeDefine('DBG_RAISE_ON_WARNINGS', 1);
- }
- if ( isset($options['not_null']) && !isset($options['default']) ) {
- $debugger->appendHTML("<b class='debug_error'>Config Error: </b>Field $f_name in config for prefix <b>".$config['Prefix']."</b> is described as NOT NULL, but does not have DEFAULT value!");
- safeDefine('DBG_RAISE_ON_WARNINGS', 1);
- }
+ foreach ($res as $field) {
+ $f_name = $field['Field'];
+ if (getArrayValue($config, 'Fields')) {
+ if ( !array_key_exists ($f_name, $config['Fields']) ) {
+ $debugger->appendHTML("<b class='debug_error'>Config Warning: </b>Field $f_name exists in the database, but is not defined in config file for prefix <b>".$config['Prefix']."</b>!");
+ $debugger->appendHTML("<b class='debug_error'>Config Error: </b>Field $f_name in config for prefix <b>".$config['Prefix']."</b> is NOT NULL in the database, but is not configured as not_null or required!");
+ safeDefine('DBG_RAISE_ON_WARNINGS', 1);
+ }
+ if ( isset($options['not_null']) && !isset($options['default']) ) {
+ $debugger->appendHTML("<b class='debug_error'>Config Error: </b>Field $f_name in config for prefix <b>".$config['Prefix']."</b> is described as NOT NULL, but does not have DEFAULT value!");