* Creates a record in the database table with current item' values
*
* @param mixed $force_id Set to TRUE to force creating of item's own ID or to value to force creating of passed id. Do not pass 1 for true, pass exactly TRUE!
* @access public
* @return bool
*/
function Create($force_id=false, $system_create=false)
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> as <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 (isset($config['ParentPrefix'])) {
// new: allow to set hook to parent prefix what ever it is
if ( is_array(getArrayValue($config, 'AggregateTags')) ) {
foreach ($config['AggregateTags'] as $aggregate_tag) {
if (isset($config['ParentPrefix'])) {
if ($aggregate_tag['AggregateTo'] == $config['ParentPrefix']) {
trigger_error('Depricated Aggregate Tag Usage [prefix: <b>'.$config['Prefix'].'</b>; AggregateTo: <b>'.$aggregate_tag['AggregateTo'].'</b>] use <b>#PARENT#</b> as <b>AggregateTo</b> value, where AggregateTo is same as ParentPrefix', E_USER_NOTICE);
}
if ($aggregate_tag['AggregateTo'] == '#PARENT#') {
- if (!array_key_exists ($f_name, $config['Fields'])) {
- $debugger->appendHTML("<b class='debug_error'>Config Warning: </b>Field <strong>$f_name</strong> exists in the database, but is not defined in config file for prefix <b>".$config['Prefix']."</b> !");
- safeDefine('DBG_RAISE_ON_WARNINGS', 1);
- }
- else {
- $options = $config['Fields'][$f_name];
- if ($field['Null'] != 'YES') {
- // MySQL5 for null returns "NO", but MySQL4 returns ""
- $debugger->appendHTML("<b class='debug_error'>Config Error: </b>Field <strong>$f_name</strong> 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 <strong>$f_name</strong> 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);
- }
-
- if (!isset($options['default'])) {
- $debugger->appendHTML("<b class='debug_error'>Config Error: </b>Default value for field <strong>$f_name</strong> in config for prefix <b>".$config['Prefix']."</b> not set !");
- $debugger->appendHTML("<b class='debug_error'>Config Error: </b>Default value for field <strong>$f_name</strong> (".var_export($options['default'], true).") in config for prefix <b>".$config['Prefix']."</b> differs from default value from field in database (".var_export($field['Default'], true).") !");
+ if (!array_key_exists ($f_name, $config['Fields'])) {
+ $debugger->appendHTML("<b class='debug_error'>Config Warning: </b>Field <strong>$f_name</strong> exists in the database, but is not defined in config file for prefix <b>".$config_link."</b> !");
+ safeDefine('DBG_RAISE_ON_WARNINGS', 1);
+ }
+ else {
+ $options = $config['Fields'][$f_name];
+ if ($field['Null'] != 'YES') {
+ // MySQL5 for null returns "NO", but MySQL4 returns ""
+ $debugger->appendHTML("<b class='debug_error'>Config Error: </b>Field <strong>$f_name</strong> in config for prefix <b>".$config_link."</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 <strong>$f_name</strong> in config for prefix <b>".$config_link."</b> is described as NOT NULL, but does not have DEFAULT value !");
+ safeDefine('DBG_RAISE_ON_WARNINGS', 1);
+ }
+
+ if (!isset($options['default'])) {
+ $debugger->appendHTML("<b class='debug_error'>Config Error: </b>Default value for field <strong>$f_name</strong> in config for prefix <b>".$config_link."</b> not set !");
+ $debugger->appendHTML("<b class='debug_error'>Config Error: </b>Default value for field <span class='debug_error'>IDField</span> <strong>$f_name</strong> (".var_export($options['default'], true).") in config for prefix <b>".$config_link."</b> differs from default value from field in database (".var_export($field['Default'], true).") !");
+ $debugger->appendHTML("<b class='debug_error'>Config Error: </b>Default value for field <strong>$f_name</strong> (".var_export($options['default'], true).") in config for prefix <b>".$config_link."</b> differs from default value from field in database (".var_export($field['Default'], true).") !");