Index: branches/5.1.x/core/units/selectors/selectors_config.php
===================================================================
diff -u -N -r13159 -r13962
--- branches/5.1.x/core/units/selectors/selectors_config.php (.../selectors_config.php) (revision 13159)
+++ branches/5.1.x/core/units/selectors/selectors_config.php (.../selectors_config.php) (revision 13962)
@@ -1,6 +1,6 @@
Array(
- 'FontStyle' => Array('type'=>'string', 'formatter'=>'kOptionsFormatter', 'options'=>Array(''=>'','inherit'=>'inherit','normal'=>'normal','italic'=>'italic','oblique'=>'oblique'), 'default'=>'' ),
- 'FontWeight' => Array('type'=>'string', 'formatter'=>'kOptionsFormatter', 'options'=>Array(''=>'','inherit'=>'inherit','100'=>'100','200'=>'200','300'=>'300','normal'=>'normal','500'=>'500','600'=>'600','bold'=>'bold','800'=>'800','900'=>'900','lighter'=>'lighter','bolder'=>'bolder') ),
- 'StyleCursor' => Array('type'=>'string', 'formatter'=>'kOptionsFormatter', 'options'=>Array(''=>'','inherit'=>'inherit','default'=>'default','auto'=>'auto','n-resize'=>'n-resize','ne-resize'=>'ne-resize','e-resize'=>'e-resize','se-resize'=>'se-resize','s-resize'=>'s-resize','sw-resize'=>'sw-resize','w-resize'=>'w-resize','nw-resize'=>'nw-resize','crosshair'=>'crosshair','pointer'=>'pointer','move'=>'move','text'=>'text','wait'=>'wait','help'=>'help','hand'=>'hand','all-scroll'=>'all-scroll','col-resize'=>'col-resize','row-resize'=>'row-resize','no-drop'=>'no-drop','not-allowed'=>'not-allowed','progress'=>'progress','vertical-text'=>'vertical-text','alias'=>'alias','cell'=>'cell','copy'=>'copy','count-down'=>'count-down','count-up'=>'count-up','count-up-down'=>'count-up-down','grab'=>'grab','grabbing'=>'grabbing','spinning'=>'spinning') ),
- 'StyleDisplay' => Array('type'=>'string', 'formatter'=>'kOptionsFormatter', 'options'=>Array(''=>'','inherit'=>'inherit','none'=>'none','inline'=>'inline','block'=>'block','inline-block'=>'inline-block','list-item'=>'list-item','marker'=>'marker','compact'=>'compact','run-in'=>'run-in','table-header-group'=>'table-header-group','table-footer-group'=>'table-footer-group','table'=>'table','inline-table'=>'inline-table','table-caption'=>'table-caption','table-row'=>'table-row','table-row-group'=>'table-row-group','table-column'=>'table-column','table-column-group'=>'table-column-group') ),
- 'TextAlign' => Array('type'=>'string', 'formatter'=>'kOptionsFormatter', 'options'=>Array(''=>'','inherit'=>'inherit','left'=>'left','right'=>'right','center'=>'center','justify'=>'justify') ),
- 'TextDecoration' => Array('type'=>'string', 'formatter'=>'kOptionsFormatter', 'options'=>Array(''=>'','inherit'=>'inherit','none'=>'none','underline'=>'underline','overline'=>'overline','line-through'=>'line-through','blink'=>'blink') ),
- 'StyleVisibility' => Array('type'=>'string', 'formatter'=>'kOptionsFormatter', 'options'=>Array(''=>'','inherit'=>'inherit','visible'=>'visible','hidden'=>'hidden','collapse'=>'collapse') ),
- 'StylePosition' => Array('type'=>'string', 'formatter'=>'kOptionsFormatter', 'options'=>Array(''=>'','inherit'=>'inherit','static'=>'static','relative'=>'relative','absolute'=>'absolute','fixed'=>'fixed') ),
+ 'FontStyle' => Array('type'=>'string', 'formatter'=>'kOptionsFormatter', 'options'=>Array(''=>'','inherit'=>'inherit','normal'=>'normal','italic'=>'italic','oblique'=>'oblique'), 'default'=>''),
+ 'FontWeight' => Array('type'=>'string', 'formatter'=>'kOptionsFormatter', 'options'=>Array(''=>'','inherit'=>'inherit','100'=>'100','200'=>'200','300'=>'300','normal'=>'normal','500'=>'500','600'=>'600','bold'=>'bold','800'=>'800','900'=>'900','lighter'=>'lighter','bolder'=>'bolder'), 'default' => ''),
+ 'StyleCursor' => Array('type'=>'string', 'formatter'=>'kOptionsFormatter', 'options'=>Array(''=>'','inherit'=>'inherit','default'=>'default','auto'=>'auto','n-resize'=>'n-resize','ne-resize'=>'ne-resize','e-resize'=>'e-resize','se-resize'=>'se-resize','s-resize'=>'s-resize','sw-resize'=>'sw-resize','w-resize'=>'w-resize','nw-resize'=>'nw-resize','crosshair'=>'crosshair','pointer'=>'pointer','move'=>'move','text'=>'text','wait'=>'wait','help'=>'help','hand'=>'hand','all-scroll'=>'all-scroll','col-resize'=>'col-resize','row-resize'=>'row-resize','no-drop'=>'no-drop','not-allowed'=>'not-allowed','progress'=>'progress','vertical-text'=>'vertical-text','alias'=>'alias','cell'=>'cell','copy'=>'copy','count-down'=>'count-down','count-up'=>'count-up','count-up-down'=>'count-up-down','grab'=>'grab','grabbing'=>'grabbing','spinning'=>'spinning'), 'default' => ''),
+ 'StyleDisplay' => Array('type'=>'string', 'formatter'=>'kOptionsFormatter', 'options'=>Array(''=>'','inherit'=>'inherit','none'=>'none','inline'=>'inline','block'=>'block','inline-block'=>'inline-block','list-item'=>'list-item','marker'=>'marker','compact'=>'compact','run-in'=>'run-in','table-header-group'=>'table-header-group','table-footer-group'=>'table-footer-group','table'=>'table','inline-table'=>'inline-table','table-caption'=>'table-caption','table-row'=>'table-row','table-row-group'=>'table-row-group','table-column'=>'table-column','table-column-group'=>'table-column-group'), 'default' => ''),
+ 'TextAlign' => Array('type'=>'string', 'formatter'=>'kOptionsFormatter', 'options'=>Array(''=>'','inherit'=>'inherit','left'=>'left','right'=>'right','center'=>'center','justify'=>'justify'), 'default' => ''),
+ 'TextDecoration' => Array('type'=>'string', 'formatter'=>'kOptionsFormatter', 'options'=>Array(''=>'','inherit'=>'inherit','none'=>'none','underline'=>'underline','overline'=>'overline','line-through'=>'line-through','blink'=>'blink'), 'default' => ''),
+ 'StyleVisibility' => Array('type'=>'string', 'formatter'=>'kOptionsFormatter', 'options'=>Array(''=>'','inherit'=>'inherit','visible'=>'visible','hidden'=>'hidden','collapse'=>'collapse'), 'default' => ''),
+ 'StylePosition' => Array('type'=>'string', 'formatter'=>'kOptionsFormatter', 'options'=>Array(''=>'','inherit'=>'inherit','static'=>'static','relative'=>'relative','absolute'=>'absolute','fixed'=>'fixed'), 'default' => ''),
),
'Grids' => Array(
Index: branches/5.1.x/core/units/structure/structure_config.php
===================================================================
diff -u -N -r13951 -r13962
--- branches/5.1.x/core/units/structure/structure_config.php (.../structure_config.php) (revision 13951)
+++ branches/5.1.x/core/units/structure/structure_config.php (.../structure_config.php) (revision 13962)
@@ -1,6 +1,6 @@
Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled' ), 'use_phrases' => 1, 'not_null' => 1,'default' => 1),
'Priority' => Array('type' => 'int', 'not_null' => 1, 'formatter' => 'kOptionsFormatter', 'options' => array(), 'required' => 1, 'default' => 0),
'MetaKeywords' => Array('type' => 'string', 'default' => null),
- 'CachedDescendantCatsQty' => Array('type' => 'int', 'default' => 0),
+ 'CachedDescendantCatsQty' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
'CachedNavbar' => Array('type' => 'string', 'formatter' => 'kMultiLanguage', 'default' => null),
- 'CreatedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'options' => Array(USER_ROOT => 'root', USER_GUEST => '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),
+ 'CreatedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'options' => Array(USER_ROOT => 'root', USER_GUEST => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'default' => NULL),
'ResourceId' => Array('type' => 'int', 'default' => null),
'ParentPath' => Array('type' => 'string', 'default' => null),
'TreeLeft' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
@@ -153,7 +153,7 @@
'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', 'default' => '#NOW#'),
- 'ModifiedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'options' => Array(USER_ROOT => 'root', USER_GUEST => '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),
+ 'ModifiedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'options' => Array(USER_ROOT => 'root', USER_GUEST => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'default' => NULL),
'CachedTemplate' => Array('type' => 'string', 'not_null' => 1, 'default' => ''),
Index: branches/5.1.x/core/units/helpers/file_helper.php
===================================================================
diff -u -N -r13750 -r13962
--- branches/5.1.x/core/units/helpers/file_helper.php (.../file_helper.php) (revision 13750)
+++ branches/5.1.x/core/units/helpers/file_helper.php (.../file_helper.php) (revision 13962)
@@ -1,6 +1,6 @@
'string',
'max_len' => 240,
'default' => '',
- 'not_null' => 1,
);
if ($is_image) {
@@ -222,7 +221,7 @@
*/
function _createCustomFields($prefix, $field_name, &$virtual_fields, $is_image)
{
- $virtual_fields['Delete' . $field_name] = Array ('type' => 'int', 'not_null' => 1, 'default' => 0);
+ $virtual_fields['Delete' . $field_name] = Array ('type' => 'int', 'default' => 0);
if ($is_image) {
$virtual_fields[$field_name . 'Alt'] = Array ('type' => 'string', 'default' => '');
Index: branches/5.1.x/core/units/custom_data/custom_data_event_handler.php
===================================================================
diff -u -N -r13470 -r13962
--- branches/5.1.x/core/units/custom_data/custom_data_event_handler.php (.../custom_data_event_handler.php) (revision 13470)
+++ branches/5.1.x/core/units/custom_data/custom_data_event_handler.php (.../custom_data_event_handler.php) (revision 13962)
@@ -1,6 +1,6 @@
$custom_params) {
$custom_name = $custom_params['FieldName'];
- $field_options = Array('type' => 'string', 'not_null' => 1, 'default' => $custom_params['DefaultValue']);
+ $field_options = Array('type' => 'string', 'default' => $custom_params['DefaultValue']);
// raises warnings during 4.3.9 -> 5.0.0 upgrade, no fatal sqls though
if ($custom_params['IsRequired']) {
Index: branches/5.1.x/core/install/install_schema.sql
===================================================================
diff -u -N -r13951 -r13962
--- branches/5.1.x/core/install/install_schema.sql (.../install_schema.sql) (revision 13951)
+++ branches/5.1.x/core/install/install_schema.sql (.../install_schema.sql) (revision 13962)
@@ -115,7 +115,7 @@
MessageType varchar(4) NOT NULL DEFAULT 'text',
Enabled int(11) NOT NULL DEFAULT '1',
FrontEndOnly tinyint(3) unsigned NOT NULL DEFAULT '0',
- Module varchar(40) NOT NULL DEFAULT '',
+ Module varchar(40) NOT NULL DEFAULT 'Core',
Description text,
`Type` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (EventId),
@@ -144,13 +144,13 @@
Priority int(11) NOT NULL DEFAULT '0',
IconURL varchar(255) DEFAULT NULL,
IconDisabledURL varchar(255) DEFAULT NULL,
- DateFormat varchar(50) NOT NULL DEFAULT '',
- TimeFormat varchar(50) NOT NULL DEFAULT '',
+ DateFormat varchar(50) NOT NULL DEFAULT 'm/d/Y',
+ TimeFormat varchar(50) NOT NULL DEFAULT 'g:i:s A',
InputDateFormat varchar(50) NOT NULL DEFAULT 'm/d/Y',
InputTimeFormat varchar(50) NOT NULL DEFAULT 'g:i:s A',
- DecimalPoint varchar(10) NOT NULL DEFAULT '',
+ DecimalPoint varchar(10) NOT NULL DEFAULT '.',
ThousandSep varchar(10) NOT NULL DEFAULT '',
- `Charset` varchar(20) NOT NULL DEFAULT '',
+ `Charset` varchar(20) NOT NULL DEFAULT 'utf-8',
UnitSystem tinyint(4) NOT NULL DEFAULT '1',
FilenameReplacements text,
Locale varchar(10) NOT NULL DEFAULT 'en-US',
@@ -420,14 +420,14 @@
`Status` tinyint(4) NOT NULL DEFAULT '1',
Priority int(11) NOT NULL DEFAULT '0',
MetaKeywords text,
- CachedDescendantCatsQty int(11) DEFAULT NULL,
+ CachedDescendantCatsQty int(11) NOT NULL DEFAULT '0',
CachedNavbar text,
l1_CachedNavbar text,
l2_CachedNavbar text,
l3_CachedNavbar text,
l4_CachedNavbar text,
l5_CachedNavbar text,
- CreatedById int(11) NOT NULL DEFAULT '0',
+ CreatedById int(11) DEFAULT NULL,
ResourceId int(11) DEFAULT NULL,
ParentPath text,
TreeLeft bigint(20) NOT NULL DEFAULT '0',
@@ -438,7 +438,7 @@
NewItem int(11) NOT NULL DEFAULT '2',
PopItem int(11) NOT NULL DEFAULT '2',
Modified int(11) DEFAULT NULL,
- ModifiedById int(11) NOT NULL DEFAULT '0',
+ ModifiedById int(11) DEFAULT NULL,
CachedTemplate varchar(255) NOT NULL DEFAULT '',
Template varchar(255) NOT NULL DEFAULT '#inherit#',
UseExternalUrl tinyint(3) unsigned NOT NULL DEFAULT '0',
@@ -792,10 +792,10 @@
ReviewId int(11) NOT NULL AUTO_INCREMENT,
CreatedOn int(10) unsigned DEFAULT NULL,
ReviewText longtext,
- Rating tinyint(3) unsigned DEFAULT NULL,
+ Rating tinyint(3) unsigned NOT NULL DEFAULT '0',
IPAddress varchar(255) NOT NULL DEFAULT '',
ItemId int(11) NOT NULL DEFAULT '0',
- CreatedById int(11) NOT NULL DEFAULT '-1',
+ CreatedById int(11) DEFAULT NULL,
ItemType tinyint(4) NOT NULL DEFAULT '0',
Priority int(11) NOT NULL DEFAULT '0',
`Status` tinyint(4) NOT NULL DEFAULT '2',
@@ -835,7 +835,7 @@
Size int(11) NOT NULL DEFAULT '0',
`Status` tinyint(4) NOT NULL DEFAULT '1',
CreatedOn int(11) unsigned DEFAULT NULL,
- CreatedById int(11) NOT NULL DEFAULT '-1',
+ CreatedById int(11) DEFAULT NULL,
MimeType varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (FileId),
KEY ResourceId (ResourceId),
@@ -1151,7 +1151,7 @@
DraftId int(11) NOT NULL AUTO_INCREMENT,
FormSubmissionId int(10) unsigned NOT NULL DEFAULT '0',
CreatedOn int(10) unsigned DEFAULT NULL,
- CreatedById int(11) NOT NULL,
+ CreatedById int(11) DEFAULT NULL,
Message text,
PRIMARY KEY (DraftId),
KEY FormSubmissionId (FormSubmissionId),
Index: branches/5.1.x/core/units/forms/drafts/drafts_config.php
===================================================================
diff -u -N -r13400 -r13962
--- branches/5.1.x/core/units/forms/drafts/drafts_config.php (.../drafts_config.php) (revision 13400)
+++ branches/5.1.x/core/units/forms/drafts/drafts_config.php (.../drafts_config.php) (revision 13962)
@@ -1,6 +1,6 @@
Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'FormSubmissionId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'CreatedOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'),
- 'CreatedById' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'CreatedById' => Array ('type' => 'int', 'default' => NULL),
'Message' => Array ('type' => 'string', 'default' => NULL),
),
);
\ No newline at end of file
Index: branches/5.1.x/core/units/category_items/category_items_config.php
===================================================================
diff -u -N -r13545 -r13962
--- branches/5.1.x/core/units/category_items/category_items_config.php (.../category_items_config.php) (revision 13545)
+++ branches/5.1.x/core/units/category_items/category_items_config.php (.../category_items_config.php) (revision 13962)
@@ -1,6 +1,6 @@
Array (
- 'CategoryName' => Array(),
- 'DummyId' => Array(),
- 'CategoryStatus' => Array(),
+ 'CategoryName' => Array ('type' => 'string', 'default' => ''),
+ 'DummyId' => Array ('type' => 'int', 'default' => 0),
+ 'CategoryStatus' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled' ), 'use_phrases' => 1, 'default' => 1),
),
'Grids' => Array (
Index: branches/5.1.x/core/units/visits/visits_config.php
===================================================================
diff -u -N -r13581 -r13962
--- branches/5.1.x/core/units/visits/visits_config.php (.../visits_config.php) (revision 13581)
+++ branches/5.1.x/core/units/visits/visits_config.php (.../visits_config.php) (revision 13962)
@@ -1,6 +1,6 @@
Array (
- 'UserName' => Array ('type' => 'string'),
- 'AffiliateUser' => Array ('type' => 'string'),
- 'AffiliatePortalUserId' => Array ('type' => 'int'),
- 'OrderTotalAmount' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%01.2f', 'not_null' => '1','default' => '0.00', 'totals' => 'SUM'),
- 'OrderTotalAmountSum' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%01.2f', 'not_null' => '1','default' => '0.00'),
- 'OrderAffiliateCommission' => Array ('type' => 'double', 'formatter' => 'kFormatter','format' => '%.02f', 'not_null' => '1','default' => '0.0000', 'totals' => 'SUM'),
- 'OrderAffiliateCommissionSum' => Array ('type' => 'double', 'formatter' => 'kFormatter','format' => '%.02f', 'not_null' => '1','default' => '0.0000'),
+ 'UserName' => Array ('type' => 'string', 'default' => ''),
+ 'AffiliateUser' => Array ('type' => 'string', 'default' => ''),
+ 'AffiliatePortalUserId' => Array ('type' => 'int', 'default' => null),
+ 'OrderTotalAmount' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%01.2f', 'default' => '0.00', 'totals' => 'SUM'),
+ 'OrderTotalAmountSum' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%01.2f', 'default' => '0.00'),
+ 'OrderAffiliateCommission' => Array ('type' => 'double', 'formatter' => 'kFormatter','format' => '%.02f', 'default' => '0.0000', 'totals' => 'SUM'),
+ 'OrderAffiliateCommissionSum' => Array ('type' => 'double', 'formatter' => 'kFormatter','format' => '%.02f', 'default' => '0.0000'),
+ 'OrderNumber' => Array ('type' => 'string', 'default' => ''),
'OrderId' => Array ('type' => 'int', 'default' => '0'),
),
Index: branches/5.1.x/core/units/relationship/relationship_config.php
===================================================================
diff -u -N -r13941 -r13962
--- branches/5.1.x/core/units/relationship/relationship_config.php (.../relationship_config.php) (revision 13941)
+++ branches/5.1.x/core/units/relationship/relationship_config.php (.../relationship_config.php) (revision 13962)
@@ -1,6 +1,6 @@
Array('type'=>'int','not_null'=>1,'default'=>0),
),
'VirtualFields' => Array(
- 'ItemName' => Array(),
- 'ItemType' => Array(),
+ 'ItemName' => Array ('type' => 'string', 'default' => ''),
+ 'ItemType' => Array ('type' => 'string', 'default' => ''),
),
'Grids' => Array(
Index: branches/5.1.x/core/units/categories/categories_config.php
===================================================================
diff -u -N -r13951 -r13962
--- branches/5.1.x/core/units/categories/categories_config.php (.../categories_config.php) (revision 13951)
+++ branches/5.1.x/core/units/categories/categories_config.php (.../categories_config.php) (revision 13962)
@@ -1,6 +1,6 @@
Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled' ), 'use_phrases' => 1, 'not_null' => 1,'default' => 1),
'Priority' => Array ('type' => 'int', 'not_null' => 1, 'formatter' => 'kOptionsFormatter', 'options' => Array (), 'default' => 0),
'MetaKeywords' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => null),
- 'CachedDescendantCatsQty' => Array ('type' => 'int', 'default' => 0),
+ 'CachedDescendantCatsQty' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'CachedNavbar' => Array ('type' => 'string', 'formatter' => 'kMultiLanguage', 'default' => null),
- 'CreatedById' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array (USER_ROOT => 'root', USER_GUEST => '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),
+ 'CreatedById' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array (USER_ROOT => 'root', USER_GUEST => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'default' => NULL),
'ResourceId' => Array ('type' => 'int', 'default' => null),
'ParentPath' => Array ('type' => 'string', 'default' => null),
'TreeLeft' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
@@ -337,7 +337,7 @@
'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', 'default' => '#NOW#'),
- 'ModifiedById' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array (USER_ROOT => 'root', USER_GUEST => '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),
+ 'ModifiedById' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array (USER_ROOT => 'root', USER_GUEST => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'default' => NULL),
'CachedTemplate' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''),
Index: branches/5.1.x/core/units/images/images_config.php
===================================================================
diff -u -N -r13941 -r13962
--- branches/5.1.x/core/units/images/images_config.php (.../images_config.php) (revision 13941)
+++ branches/5.1.x/core/units/images/images_config.php (.../images_config.php) (revision 13962)
@@ -1,6 +1,6 @@
Array('Name' => 'asc'),
)
),
-
+
'Fields' => Array (
'ImageId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'ResourceId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
@@ -126,7 +126,7 @@
'Enabled' => Array (
'type' => 'int', 'formatter' => 'kOptionsFormatter',
'options' => Array (1 => 'la_Enabled', 0 => 'la_Disabled',),
- 'default' => 0, 'not_null' => 1, 'use_phrases' => 1,
+ 'default' => 1, 'not_null' => 1, 'use_phrases' => 1,
),
'DefaultImg' => Array (
'type' => 'int', 'formatter' => 'kOptionsFormatter',
@@ -158,8 +158,8 @@
),
'VirtualFields' => Array(
- 'Preview' => Array(),
- 'ImageUrl' => Array(),
+ 'Preview' => Array ('type' => 'string', 'default' => ''),
+ 'ImageUrl' => Array ('type' => 'string', 'default' => ''),
),
'Grids' => Array(
Index: branches/5.1.x/core/units/email_events/email_events_config.php
===================================================================
diff -u -N -r13941 -r13962
--- branches/5.1.x/core/units/email_events/email_events_config.php (.../email_events_config.php) (revision 13941)
+++ branches/5.1.x/core/units/email_events/email_events_config.php (.../email_events_config.php) (revision 13962)
@@ -1,6 +1,6 @@
Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'To', 2 => 'Cc', 3 => 'Bcc'),
- 'not_null' => 1, 'default' => 1
+ 'default' => 1
),
- 'RecipientName' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
+ 'RecipientName' => Array ('type' => 'string', 'max_len' => 255, 'default' => ''),
'RecipientAddressType' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_opt_Email', 2 => 'la_opt_User', 3 => 'la_opt_Group'), 'use_phrases' => 1,
- 'not_null' => 1, 'error_field' => 'RecipientAddress', 'default' => 0
+ 'error_field' => 'RecipientAddress', 'default' => 0
),
'RecipientAddress' => Array (
'type' => 'string', 'max_len' => 255,
@@ -212,7 +212,7 @@
'invalid_user' => '!la_error_UserNotFound!',
'invalid_group' => '!la_error_GroupNotFound!',
),
- 'not_null' => 1, 'default' => ''
+ 'default' => ''
),
'Tag' => Array ('type' => 'string', 'default' => ''),
Index: branches/5.1.x/core/units/logs/session_logs/session_logs_config.php
===================================================================
diff -u -N -r13581 -r13962
--- branches/5.1.x/core/units/logs/session_logs/session_logs_config.php (.../session_logs_config.php) (revision 13581)
+++ branches/5.1.x/core/units/logs/session_logs/session_logs_config.php (.../session_logs_config.php) (revision 13962)
@@ -1,6 +1,6 @@
Array(
'Duration' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'date_format' => '', 'time_format' => 'H:i:s', 'use_timezone' => false, 'default' => NULL),
+ 'UserLogin' => Array ('type' => 'string', 'default' => ''),
+ 'UserFirstName' => Array ('type' => 'string', 'default' => ''),
+ 'UserLastName' => Array ('type' => 'string', 'default' => ''),
+ 'UserEmail' => Array ('type' => 'string', 'default' => ''),
),
'Grids' => Array (
@@ -114,6 +118,7 @@
'UserLogin' => Array ('title' => 'la_col_Username', 'filter_block' => 'grid_like_filter', 'width' => 100, ),
'UserFirstName' => Array ('title' => 'la_col_FirstName', 'filter_block' => 'grid_like_filter', 'width' => 120, ),
'UserLastName' => Array ('title' => 'la_col_LastName', 'filter_block' => 'grid_like_filter', 'width' => 120, ),
+ 'UserEmail' => Array ('title' => 'la_col_Email', 'filter_block' => 'grid_like_filter', 'width' => 120, ),
'SessionStart' => Array ('title' => 'la_col_SessionStart', 'filter_block' => 'grid_date_range_filter', 'width' => 120, ),
'SessionEnd' => Array ('title' => 'la_col_SessionEnd', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ),
'Duration' => Array ('title' => 'la_col_Duration', 'filter_block' => 'grid_range_filter', 'width' => 100, ),
Index: branches/5.1.x/core/units/logs/change_logs/change_logs_config.php
===================================================================
diff -u -N -r13581 -r13962
--- branches/5.1.x/core/units/logs/change_logs/change_logs_config.php (.../change_logs_config.php) (revision 13581)
+++ branches/5.1.x/core/units/logs/change_logs/change_logs_config.php (.../change_logs_config.php) (revision 13962)
@@ -1,6 +1,6 @@
Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
),
+ 'VirtualFields' => Array (
+ 'UserLogin' => Array ('type' => 'string', 'default' => ''),
+ 'UserFirstName' => Array ('type' => 'string', 'default' => ''),
+ 'UserLastName' => Array ('type' => 'string', 'default' => ''),
+ 'UserEmail' => Array ('type' => 'string', 'default' => ''),
+ ),
+
'Grids' => Array (
'Default' => Array (
'Icons' => Array ('default' => 'icon16_item.png'),
@@ -139,6 +146,7 @@
'UserLogin' => Array ('title' => 'la_col_Username', 'filter_block' => 'grid_like_filter', 'width' => 100, ),
'UserFirstName' => Array ('title' => 'la_col_FirstName', 'filter_block' => 'grid_like_filter', 'width' => 120, ),
'UserLastName' => Array ('title' => 'la_col_LastName', 'filter_block' => 'grid_like_filter', 'width' => 120, ),
+ 'UserEmail' => Array ('title' => 'la_col_Email', 'filter_block' => 'grid_like_filter', 'width' => 120, ),
'SessionLogId' => Array ('title' => 'la_col_SessionLogId', 'filter_block' => 'grid_range_filter', 'width' => 120, ),
'Action' => Array ('title' => 'la_col_Action', 'filter_block' => 'grid_options_filter', 'width' => 120, ),
'OccuredOn' => Array ('title' => 'la_col_OccuredOn', 'filter_block' => 'grid_date_range_filter', 'width' => 150, ),
Index: branches/5.1.x/core/units/reviews/reviews_config.php
===================================================================
diff -u -N -r13941 -r13962
--- branches/5.1.x/core/units/reviews/reviews_config.php (.../reviews_config.php) (revision 13941)
+++ branches/5.1.x/core/units/reviews/reviews_config.php (.../reviews_config.php) (revision 13962)
@@ -1,6 +1,6 @@
'lu_Rating_4',
5 => 'lu_Rating_5'),
'use_phrases' => 1,
- 'min_value_inc' => 0, 'max_value_inc' => 5, 'default' => 0,
+ 'min_value_inc' => 0, 'max_value_inc' => 5, 'not_null' => 1, 'default' => 0,
),
'IPAddress' => Array (
'type' => 'string',
@@ -140,7 +140,7 @@
WHERE `%s` = \'%s\' ',
'left_key_field' => 'PortalUserId',
'left_title_field' => 'Login',
- 'required' => 1, 'not_null' => 1, 'default' => USER_ROOT,
+ 'required' => 1, 'default' => NULL,
'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'),
),
'ItemType' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
@@ -169,6 +169,9 @@
'CatalogItemName' => Array ('type' => 'string', 'default' => ''),
'CatalogItemId' => Array ('type' => 'int', 'default' => 0),
'CatalogItemCategory' => Array ('type' => 'int', 'default' => 0),
+
+ 'ItemName' => Array ('type' => 'string', 'default' => ''),
+ 'ProductId' => Array ('type' => 'int', 'default' => 0),
),
'Grids' => Array (
Index: branches/5.1.x/core/units/phrases/phrases_config.php
===================================================================
diff -u -N -r13941 -r13962
--- branches/5.1.x/core/units/phrases/phrases_config.php (.../phrases_config.php) (revision 13941)
+++ branches/5.1.x/core/units/phrases/phrases_config.php (.../phrases_config.php) (revision 13962)
@@ -1,6 +1,6 @@
Array (
- 'Groups' => Array (
+ 'Groups' => Array (
Array ('mode' => 'AND', 'filters' => Array ('translated', 'not_translated'), 'type' => HAVING_FILTER),
),
- 'Filters' => Array (
+ 'Filters' => Array (
'translated' => Array ('label' => 'la_PhraseTranslated', 'on_sql' => '', 'off_sql' => 'CurrentTranslation IS NULL'),
'not_translated' => Array ('label' => 'la_PhraseNotTranslated', 'on_sql' => '', 'off_sql' => 'CurrentTranslation IS NOT NULL'),
)
@@ -146,7 +146,7 @@
0 => 'la_No',
1 => 'la_Yes',
),
- 'use_phrases' => 1, 'not_null' => 1, 'default' => 0,
+ 'use_phrases' => 1, 'default' => 0,
),
'DoNotEncode' => Array (
'type' => 'int',
@@ -155,7 +155,7 @@
0 => 'la_No',
1 => 'la_Yes',
),
- 'use_phrases' => 1, 'not_null' => 1, 'default' => 0,
+ 'use_phrases' => 1, 'default' => 0,
),
'ExportPhrases' => Array ('type' => 'string', 'default' => ''),
'ExportEmailEvents' => Array ('type' => 'string', 'default' => ''),
Index: branches/5.1.x/core/kernel/utility/unit_config_reader.php
===================================================================
diff -u -N -r13956 -r13962
--- branches/5.1.x/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 13956)
+++ branches/5.1.x/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 13962)
@@ -1,6 +1,6 @@
'Field %s is described as NOT NULL in config, but does not have DEFAULT value',
'not_null_error3' => 'Field %s is described as NOT NULL in config, but is NULL in db',
'invalid_default' => 'Default value for field %s%s not sync. to db (in config = %s, in db = %s)',
+ 'date_column_not_null_error' => 'Field %s must be NULL in config and database, since it contains date',
+ 'user_column_default_error' => 'Field %s must be have NULL as default value, since it holds user id',
'type_missing' => 'Type definition for field %s missing in config',
+ 'virtual_type_missing' => 'Type definition for virtual field %s missing in config',
+ 'virtual_default_missing' => 'Default value for virtual field %s not set in config',
+ 'virtual_not_null_error' => 'Virtual field %s cannot be not null, since it doesn\'t exist in database',
'invalid_calculated_field' => 'Calculated field %s is missing corresponding virtual field',
);
@@ -670,6 +675,7 @@
$default_missing = false;
$options = $config['Fields'][$f_name];
$not_null = isset($options['not_null']) && $options['not_null'];
+ $formatter = array_key_exists('formatter', $options) ? $options['formatter'] : false;
if (!array_key_exists('default', $options)) {
$config_errors[] = sprintf($error_messages['default_missing'], $f_name);
@@ -689,11 +695,24 @@
$config_errors[] = sprintf($error_messages['not_null_error3'], $f_name);
}
+ if (($formatter == 'kDateFormatter') && $not_null) {
+ $config_errors[] = sprintf($error_messages['date_column_not_null_error'], $f_name);
+ }
+
+ // columns, holding userid should have NULL as default value
+ if (array_key_exists('type', $options) && !$default_missing) {
+ // both type and default value set
+
+ if (preg_match('/ById$/', $f_name) && $options['default'] !== null) {
+ $config_errors[] = sprintf($error_messages['user_column_default_error'], $f_name);
+ }
+ }
+
if (!array_key_exists('type', $options)) {
$config_errors[] = sprintf($error_messages['type_missing'], $f_name);
}
- if (!$default_missing) {
+ if (!$default_missing && ($field['Type'] != 'text')) {
if ( is_null($db_default) && $not_null ) {
$db_default = $options['type'] == 'string' ? '' : 0;
}
@@ -709,6 +728,23 @@
}
}
+ // validate virtual fields
+ if ( array_key_exists('VirtualFields', $config) ) {
+ foreach ($config['VirtualFields'] as $f_name => $options) {
+ if (!array_key_exists('type', $options)) {
+ $config_errors[] = sprintf($error_messages['virtual_type_missing'], $f_name);
+ }
+
+ if (array_key_exists('not_null', $options)) {
+ $config_errors[] = sprintf($error_messages['virtual_not_null_error'], $f_name);
+ }
+
+ if (!array_key_exists('default', $options)) {
+ $config_errors[] = sprintf($error_messages['virtual_default_missing'], $f_name);
+ }
+ }
+ }
+
// validate calculated fields
if ( array_key_exists('CalculatedFields', $config) ) {
foreach ($config['CalculatedFields'] as $special => $calculated_fields) {
@@ -718,6 +754,8 @@
}
}
}
+
+ $config_errors = array_unique($config_errors);
}
if ($config_errors) {
Index: branches/5.1.x/core/units/user_groups/user_groups_config.php
===================================================================
diff -u -N -r13159 -r13962
--- branches/5.1.x/core/units/user_groups/user_groups_config.php (.../user_groups_config.php) (revision 13159)
+++ branches/5.1.x/core/units/user_groups/user_groups_config.php (.../user_groups_config.php) (revision 13962)
@@ -1,6 +1,6 @@
Array (
- 'UserName' => Array('type' => 'string'),
- 'UserLogin' => Array('type' => 'string'),
+ 'UserName' => Array('type' => 'string', 'default' => ''),
+ 'UserLogin' => Array('type' => 'string', 'default' => ''),
),
'Grids' => Array(
'GroupUsers' => Array(
@@ -108,8 +108,8 @@
),
'VirtualFields' => Array (
- 'GroupName' => Array('type' => 'string'),
- 'GroupDescription' => Array('type' => 'string'),
+ 'GroupName' => Array('type' => 'string', 'default' => ''),
+ 'GroupDescription' => Array('type' => 'string', 'default' => ''),
),
Index: branches/5.1.x/core/units/users/users_config.php
===================================================================
diff -u -N -r13941 -r13962
--- branches/5.1.x/core/units/users/users_config.php (.../users_config.php) (revision 13941)
+++ branches/5.1.x/core/units/users/users_config.php (.../users_config.php) (revision 13962)
@@ -1,6 +1,6 @@
Array('type' => 'int', 'formatter'=>'kOptionsFormatter', 'options'=>Array(1=>'la_Enabled', 0=>'la_Disabled', 2=>'la_Pending'), 'use_phrases'=>1, 'not_null' => '1','default' => 1),
'Modified' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'),
'dob' => Array('type'=>'int', 'formatter' => 'kDateFormatter', 'default' => null),
- 'tz' => Array('type' => 'int','default' => 0),
+ 'tz' => Array('type' => 'int', 'default' => NULL),
'ip' => Array('type' => 'string','default' => null),
'IsBanned' => Array('type' => 'int','not_null' => 1, 'default' => 0),
'PassResetTime' => Array('type' => 'int','default' => null),
@@ -413,7 +413,7 @@
'UserGroup' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter', 'options_sql' => 'SELECT %1$s FROM ' . TABLE_PREFIX . 'PortalGroup WHERE Enabled = 1 AND FrontRegistration = 1', 'option_key_field' => 'GroupId', 'option_title_field' => 'Name',
- 'not_null' => 1, 'default' => 0,
+ 'default' => 0,
),
),
Index: branches/5.1.x/core/install/upgrades.sql
===================================================================
diff -u -N -r13951 -r13962
--- branches/5.1.x/core/install/upgrades.sql (.../upgrades.sql) (revision 13951)
+++ branches/5.1.x/core/install/upgrades.sql (.../upgrades.sql) (revision 13962)
@@ -1951,4 +1951,29 @@
ADD INDEX ( `Protected` );
UPDATE Category SET `Type` = IF(`Protected` = 1, 2, 1);
-UPDATE Category SET `Protected` = 1 WHERE ThemeId > 0;
\ No newline at end of file
+UPDATE Category SET `Protected` = 1 WHERE ThemeId > 0;
+
+ALTER TABLE Category CHANGE CachedDescendantCatsQty CachedDescendantCatsQty INT(11) NOT NULL DEFAULT '0';
+ALTER TABLE Events CHANGE `Module` `Module` VARCHAR(40) NOT NULL DEFAULT 'Core';
+
+ALTER TABLE Language
+ CHANGE DateFormat DateFormat VARCHAR(50) NOT NULL DEFAULT 'm/d/Y',
+ CHANGE TimeFormat TimeFormat VARCHAR(50) NOT NULL DEFAULT 'g:i:s A',
+ CHANGE DecimalPoint DecimalPoint VARCHAR(10) NOT NULL DEFAULT '.',
+ CHANGE Charset Charset VARCHAR(20) NOT NULL DEFAULT 'utf-8';
+
+ALTER TABLE ItemReview CHANGE Rating Rating TINYINT(3) UNSIGNED NOT NULL DEFAULT '0';
+UPDATE PortalUser SET tz = NULL;
+
+ALTER TABLE Category
+ CHANGE CreatedById CreatedById INT(11) NULL DEFAULT NULL,
+ CHANGE ModifiedById ModifiedById INT(11) NULL DEFAULT NULL;
+UPDATE Category SET CreatedById = NULL WHERE CreatedById = 0;
+UPDATE Category SET ModifiedById = NULL WHERE ModifiedById = 0;
+
+ALTER TABLE ItemFiles CHANGE CreatedById CreatedById INT(11) NULL DEFAULT NULL;
+
+ALTER TABLE Drafts CHANGE CreatedById CreatedById INT(11) NULL DEFAULT NULL;
+UPDATE Drafts SET CreatedById = NULL WHERE CreatedById = 0;
+
+ALTER TABLE ItemReview CHANGE CreatedById CreatedById INT(11) NULL DEFAULT NULL;
\ No newline at end of file
Index: branches/5.1.x/core/units/custom_fields/custom_fields_config.php
===================================================================
diff -u -N -r13545 -r13962
--- branches/5.1.x/core/units/custom_fields/custom_fields_config.php (.../custom_fields_config.php) (revision 13545)
+++ branches/5.1.x/core/units/custom_fields/custom_fields_config.php (.../custom_fields_config.php) (revision 13962)
@@ -1,6 +1,6 @@
Array ('type' => 'string', 'not_null' => 1, 'default' => ''),
- 'OptionTitle' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''),
- 'Options' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''),
+ 'OptionKey' => Array ('type' => 'string', 'default' => ''),
+ 'OptionTitle' => Array ('type' => 'string', 'default' => ''),
+ 'Options' => Array ('type' => 'string', 'default' => ''),
),
Index: branches/5.1.x/core/units/files/files_config.php
===================================================================
diff -u -N -r13941 -r13962
--- branches/5.1.x/core/units/files/files_config.php (.../files_config.php) (revision 13941)
+++ branches/5.1.x/core/units/files/files_config.php (.../files_config.php) (revision 13962)
@@ -1,6 +1,6 @@
1, 'default' => 1,
),
'CreatedOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'),
- 'CreatedById' => Array ('type' => 'int', 'not_null' => 1, 'default' => USER_ROOT),
+ 'CreatedById' => Array ('type' => 'int', 'default' => NULL),
'MimeType' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
),