Index: trunk/kernel/units/general/cat_event_handler.php =================================================================== diff -u -N -r5121 -r5162 --- trunk/kernel/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 5121) +++ trunk/kernel/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 5162) @@ -489,7 +489,10 @@ $object =& $event->getObject( Array('skip_autoload' => true) ); $property_map = $this->Application->getUnitOption($event->Prefix, 'ItemPropertyMappings'); - + if (!$property_map) { + return ; + } + // new items $object->addCalculatedField('IsNew', ' IF(%1$s.NewItem = 2, IF(%1$s.CreatedOn >= (UNIX_TIMESTAMP() - '. Index: trunk/core/units/general/cat_event_handler.php =================================================================== diff -u -N -r5121 -r5162 --- trunk/core/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 5121) +++ trunk/core/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 5162) @@ -489,7 +489,10 @@ $object =& $event->getObject( Array('skip_autoload' => true) ); $property_map = $this->Application->getUnitOption($event->Prefix, 'ItemPropertyMappings'); - + if (!$property_map) { + return ; + } + // new items $object->addCalculatedField('IsNew', ' IF(%1$s.NewItem = 2, IF(%1$s.CreatedOn >= (UNIX_TIMESTAMP() - '. Index: trunk/core/units/categories/categories_config.php =================================================================== diff -u -N -r5102 -r5162 --- trunk/core/units/categories/categories_config.php (.../categories_config.php) (revision 5102) +++ trunk/core/units/categories/categories_config.php (.../categories_config.php) (revision 5162) @@ -197,35 +197,35 @@ 'Fields' => Array ( - 'CategoryId' => Array('type' => 'int','not_null' => '1','default' => ''), - 'Type' => Array('type' => 'int','not_null' => '1','default' => '0'), - 'ParentId' => Array('type' => 'int','not_null' => '1','default' => '0'), - 'Name' => Array('type' => 'string','not_null' => '1','default' => ''), - 'Filename' => Array('type' => 'string','not_null' => '1','default' => ''), - 'AutomaticFilename' => Array('type' => 'int','not_null' => '1','default' => '1'), - 'Description' => Array('type' => 'string','not_null' => '1','default' => ''), - 'CreatedOn' => Array('formatter' => 'kDateFormatter', 'default'=>'#NOW#', 'not_null' => '1'), - 'EditorsPick' => Array('type' => 'int','default' => ''), - 'Status' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array ( 1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled' ), 'use_phrases' => 1, 'not_null' => '1','default' => 2), - 'Pop' => Array('type' => 'int','default' => ''), - 'Priority' => Array('type' => 'int', 'not_null' => 1, 'default' => ''), - 'MetaKeywords' => Array('type' => 'string','default' => ''), - 'CachedDescendantCatsQty' => Array('type' => 'int','default' => ''), - 'CachedNavbar' => Array('type' => 'string','not_null' => '1','default' => ''), - 'CreatedById' => Array('type' => 'int','not_null' => '1','default' => '0'), - 'ResourceId' => Array('type' => 'int','default' => ''), - 'ParentPath' => Array('type' => 'string','not_null' => '1','default' => ''), - 'NamedParentPath' => Array('type' => 'string','not_null' => '1','default' => ''), - 'MetaDescription' => Array('type' => 'string','default' => ''), - 'HotItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => '1', 'default' => 2), - 'NewItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => '1', 'default' => 2), - 'PopItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => '1', 'default' => 2), - 'Modified' => Array('type' => 'int','not_null' => '1','default' => '0'), - 'ModifiedById' => Array('type' => 'int','not_null' => '1','default' => '0'), - 'CategoryTemplate' => Array('type' => 'string','not_null' => '1','default' => ''), - 'ItemTemplate' => Array('type' => 'string','not_null' => '1','default' => ''), - 'CachedCategoryTemplate' => Array('type' => 'string','not_null' => '1','default' => ''), - 'CachedItemTemplate' => Array('type' => 'string','not_null' => '1','default' => ''), + 'CategoryId' => Array('type' => 'int','not_null' => 1,'default' => ''), + 'Type' => Array('type' => 'int','not_null' => 1,'default' => 0), + 'ParentId' => Array('type' => 'int','not_null' => 1,'default' => 0), + 'Name' => Array('type' => 'string', 'not_null' => 1, 'required' => 1, 'default' => ''), + 'Filename' => Array('type' => 'string', 'not_null' => 1, 'default' => ''), + 'AutomaticFilename' => Array('type' => 'int', 'not_null' => 1, 'default' => 1), + 'Description' => Array('type' => 'string', 'not_null' => 1, 'required' => 1, 'default' => ''), + 'CreatedOn' => Array('formatter' => 'kDateFormatter', 'default'=>'#NOW#', 'required' => 1, 'not_null' => 1), + 'EditorsPick' => Array('type' => 'int', 'not_null' => 1, 'default' => 0), + 'Status' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled' ), 'use_phrases' => 1, 'not_null' => 1,'default' => 2), + 'Pop' => Array('type' => 'int', 'default' => ''), + 'Priority' => Array('type' => 'int', 'not_null' => 1, 'default' => ''), + 'MetaKeywords' => Array('type' => 'string', 'default' => ''), + 'CachedDescendantCatsQty' => Array('type' => 'int', 'default' => ''), + 'CachedNavbar' => Array('type' => 'string', 'not_null' => 1, 'default' => ''), + 'CreatedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1,'default' => '0'), + 'ResourceId' => Array('type' => 'int', 'default' => ''), + 'ParentPath' => Array('type' => 'string', 'not_null' => 1, 'default' => ''), + 'NamedParentPath' => Array('type' => 'string', 'not_null' => 1, 'default' => ''), + 'MetaDescription' => Array('type' => 'string', 'default' => ''), + 'HotItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2), + 'NewItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2), + 'PopItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2), + 'Modified' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'not_null' => 1,'default' => '#NOW#'), + 'ModifiedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1,'default' => '0'), + 'CategoryTemplate' => Array('type' => 'string', 'not_null' => 1, 'default' => ''), + 'ItemTemplate' => Array('type' => 'string', 'not_null' => 1, 'default' => ''), + 'CachedCategoryTemplate' => Array('type' => 'string', 'not_null' => 1, 'default' => ''), + 'CachedItemTemplate' => Array('type' => 'string', 'not_null' => 1, 'default' => ''), ), 'VirtualFields' => Array( Index: trunk/kernel/units/categories/categories_config.php =================================================================== diff -u -N -r5102 -r5162 --- trunk/kernel/units/categories/categories_config.php (.../categories_config.php) (revision 5102) +++ trunk/kernel/units/categories/categories_config.php (.../categories_config.php) (revision 5162) @@ -197,35 +197,35 @@ 'Fields' => Array ( - 'CategoryId' => Array('type' => 'int','not_null' => '1','default' => ''), - 'Type' => Array('type' => 'int','not_null' => '1','default' => '0'), - 'ParentId' => Array('type' => 'int','not_null' => '1','default' => '0'), - 'Name' => Array('type' => 'string','not_null' => '1','default' => ''), - 'Filename' => Array('type' => 'string','not_null' => '1','default' => ''), - 'AutomaticFilename' => Array('type' => 'int','not_null' => '1','default' => '1'), - 'Description' => Array('type' => 'string','not_null' => '1','default' => ''), - 'CreatedOn' => Array('formatter' => 'kDateFormatter', 'default'=>'#NOW#', 'not_null' => '1'), - 'EditorsPick' => Array('type' => 'int','default' => ''), - 'Status' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array ( 1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled' ), 'use_phrases' => 1, 'not_null' => '1','default' => 2), - 'Pop' => Array('type' => 'int','default' => ''), - 'Priority' => Array('type' => 'int', 'not_null' => 1, 'default' => ''), - 'MetaKeywords' => Array('type' => 'string','default' => ''), - 'CachedDescendantCatsQty' => Array('type' => 'int','default' => ''), - 'CachedNavbar' => Array('type' => 'string','not_null' => '1','default' => ''), - 'CreatedById' => Array('type' => 'int','not_null' => '1','default' => '0'), - 'ResourceId' => Array('type' => 'int','default' => ''), - 'ParentPath' => Array('type' => 'string','not_null' => '1','default' => ''), - 'NamedParentPath' => Array('type' => 'string','not_null' => '1','default' => ''), - 'MetaDescription' => Array('type' => 'string','default' => ''), - 'HotItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => '1', 'default' => 2), - 'NewItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => '1', 'default' => 2), - 'PopItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => '1', 'default' => 2), - 'Modified' => Array('type' => 'int','not_null' => '1','default' => '0'), - 'ModifiedById' => Array('type' => 'int','not_null' => '1','default' => '0'), - 'CategoryTemplate' => Array('type' => 'string','not_null' => '1','default' => ''), - 'ItemTemplate' => Array('type' => 'string','not_null' => '1','default' => ''), - 'CachedCategoryTemplate' => Array('type' => 'string','not_null' => '1','default' => ''), - 'CachedItemTemplate' => Array('type' => 'string','not_null' => '1','default' => ''), + 'CategoryId' => Array('type' => 'int','not_null' => 1,'default' => ''), + 'Type' => Array('type' => 'int','not_null' => 1,'default' => 0), + 'ParentId' => Array('type' => 'int','not_null' => 1,'default' => 0), + 'Name' => Array('type' => 'string', 'not_null' => 1, 'required' => 1, 'default' => ''), + 'Filename' => Array('type' => 'string', 'not_null' => 1, 'default' => ''), + 'AutomaticFilename' => Array('type' => 'int', 'not_null' => 1, 'default' => 1), + 'Description' => Array('type' => 'string', 'not_null' => 1, 'required' => 1, 'default' => ''), + 'CreatedOn' => Array('formatter' => 'kDateFormatter', 'default'=>'#NOW#', 'required' => 1, 'not_null' => 1), + 'EditorsPick' => Array('type' => 'int', 'not_null' => 1, 'default' => 0), + 'Status' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled' ), 'use_phrases' => 1, 'not_null' => 1,'default' => 2), + 'Pop' => Array('type' => 'int', 'default' => ''), + 'Priority' => Array('type' => 'int', 'not_null' => 1, 'default' => ''), + 'MetaKeywords' => Array('type' => 'string', 'default' => ''), + 'CachedDescendantCatsQty' => Array('type' => 'int', 'default' => ''), + 'CachedNavbar' => Array('type' => 'string', 'not_null' => 1, 'default' => ''), + 'CreatedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1,'default' => '0'), + 'ResourceId' => Array('type' => 'int', 'default' => ''), + 'ParentPath' => Array('type' => 'string', 'not_null' => 1, 'default' => ''), + 'NamedParentPath' => Array('type' => 'string', 'not_null' => 1, 'default' => ''), + 'MetaDescription' => Array('type' => 'string', 'default' => ''), + 'HotItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2), + 'NewItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2), + 'PopItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2), + 'Modified' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'not_null' => 1,'default' => '#NOW#'), + 'ModifiedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1,'default' => '0'), + 'CategoryTemplate' => Array('type' => 'string', 'not_null' => 1, 'default' => ''), + 'ItemTemplate' => Array('type' => 'string', 'not_null' => 1, 'default' => ''), + 'CachedCategoryTemplate' => Array('type' => 'string', 'not_null' => 1, 'default' => ''), + 'CachedItemTemplate' => Array('type' => 'string', 'not_null' => 1, 'default' => ''), ), 'VirtualFields' => Array(