diff --git a/Application.cfc b/Application.cfc index 3fc07869f..7dbf3c473 100644 --- a/Application.cfc +++ b/Application.cfc @@ -125,7 +125,7 @@ component { }; // cfformat-ignore-end - //applicationStop();abort; + // applicationStop();abort; /*****************************************************************************************************/ /************************************** CF APP LISTENERS *********************************************/ diff --git a/modules/contentbox/migrations/2020_01_01_150933_init.cfc b/modules/contentbox/migrations/2020_01_01_150933_init.cfc index 0f890dc61..7637dd395 100755 --- a/modules/contentbox/migrations/2020_01_01_150933_init.cfc +++ b/modules/contentbox/migrations/2020_01_01_150933_init.cfc @@ -4,7 +4,7 @@ component { // DI - property name = "migrationService" inject = "MigrationService@cfmigrations"; + property name="migrationService" inject="MigrationService@cfmigrations"; // Include Utils include template = "./util/MigrationUtils.cfm"; @@ -53,10 +53,10 @@ component { migrations.each( ( migration, record ) => { systemOutput( "Migrating [#migration#]...", true ); - if( !schema.hasTable( record.table ) ){ + if ( !schema.hasTable( record.table ) ) { newDB = true; systemOutput( "- Table doesn't exist (#record.table#) creating it...", true ); - new "init.create_#migration#"().up( schema, query ); + new "init.create_#migration#"( ).up( schema, query ); } else { systemOutput( "√ Table (#record.table#) already exists, skipping...", true ); } @@ -66,7 +66,7 @@ component { // Seed the database only if we created the tables // This protects agains seeding an already ran migration - if( newDB ){ + if ( newDB ) { systemOutput( "- Database seeding required, starting...", true ); new init.seed_permissions().seed( schema, query ); diff --git a/modules/contentbox/migrations/2022_11_23_142439_v_6_0_0_Convert-Featured-cbfs.cfc b/modules/contentbox/migrations/2022_11_23_142439_v_6_0_0_Convert-Featured-cbfs.cfc index 0f90fe04a..6ef1ca47a 100755 --- a/modules/contentbox/migrations/2022_11_23_142439_v_6_0_0_Convert-Featured-cbfs.cfc +++ b/modules/contentbox/migrations/2022_11_23_142439_v_6_0_0_Convert-Featured-cbfs.cfc @@ -15,8 +15,8 @@ component { .where( "isCore", 1 ) .first(); - if( !structKeyExists( mediaRoot, "value" ) ){ - systemoutput( "Media root doesn't exist, skipping migration", true ); + if ( !structKeyExists( mediaRoot, "value" ) ) { + systemOutput( "Media root doesn't exist, skipping migration", true ); return; } diff --git a/modules/contentbox/migrations/2023_12_12_164002_EditorsCanClearCaches.cfc b/modules/contentbox/migrations/2023_12_12_164002_EditorsCanClearCaches.cfc index 5fd4aab25..edad66d70 100755 --- a/modules/contentbox/migrations/2023_12_12_164002_EditorsCanClearCaches.cfc +++ b/modules/contentbox/migrations/2023_12_12_164002_EditorsCanClearCaches.cfc @@ -14,10 +14,9 @@ component { include template="./util/MigrationUtils.cfm"; function up( schema, qb ){ - var today = now(); + var today = now(); var permID = createUUID(); - qb - .newQuery() + qb.newQuery() .from( "cb_permission" ) .insert( { "permissionID" : permID, @@ -37,13 +36,9 @@ component { .where( "role", "Administrator" ) .first(); - qb - .newQuery() + qb.newQuery() .from( "cb_rolePermissions" ) - .insert( { - "FK_roleID" : admin.roleID, - "FK_permissionID" : permID - } ); + .insert( { "FK_roleID" : admin.roleID, "FK_permissionID" : permID } ); systemOutput( "√ - Admin role updated with new permissions", true ); var editor = qb @@ -53,15 +48,10 @@ component { .where( "role", "Editor" ) .first(); - qb - .newQuery() + qb.newQuery() .from( "cb_rolePermissions" ) - .insert( { - "FK_roleID" : editor.roleID, - "FK_permissionID" : permID - } ); + .insert( { "FK_roleID" : editor.roleID, "FK_permissionID" : permID } ); systemOutput( "√ - Editor role updated with new permissions", true ); - } function down( schema, qb ){ diff --git a/modules/contentbox/migrations/init/create_author.cfc b/modules/contentbox/migrations/init/create_author.cfc index f55d41d3a..50c69edf4 100644 --- a/modules/contentbox/migrations/init/create_author.cfc +++ b/modules/contentbox/migrations/init/create_author.cfc @@ -1,7 +1,6 @@ -component{ +component { function up( schema, query ){ - schema.create( "cb_author", ( table ) => { // Base Columns table.string( "authorID", 36 ).primaryKey(); @@ -23,7 +22,10 @@ component{ // Relationships table.string( "FK_roleID", 36 ); - table.foreignKey( "FK_roleID" ).references( "roleID" ).onTable( "cb_role" ); + table + .foreignKey( "FK_roleID" ) + .references( "roleID" ) + .onTable( "cb_role" ); // Indexes table.index( [ "email" ], "idx_email" ); @@ -33,8 +35,6 @@ component{ table.index( [ "is2FactorAuth" ], "idx_2factorauth" ); table.index( [ "username", "password", "isActive" ], "idx_login" ); } ); - } - } diff --git a/modules/contentbox/migrations/init/create_author_permission_groups.cfc b/modules/contentbox/migrations/init/create_author_permission_groups.cfc index d99293517..63f48be61 100644 --- a/modules/contentbox/migrations/init/create_author_permission_groups.cfc +++ b/modules/contentbox/migrations/init/create_author_permission_groups.cfc @@ -1,15 +1,19 @@ component { - function up( schema, query ){ - - schema.create( "cb_authorPermissionGroups", function(table) { + function up( schema, query ){ + schema.create( "cb_authorPermissionGroups", function( table ){ table.string( "FK_permissionGroupID", 36 ); table.string( "FK_authorID", 36 ); - table.foreignKey( "FK_permissionGroupID" ).references( "permissionGroupID" ).onTable( "cb_permissionGroup" ); - table.foreignKey( "FK_authorID" ).references( "authorID" ).onTable( "cb_author" ); + table + .foreignKey( "FK_permissionGroupID" ) + .references( "permissionGroupID" ) + .onTable( "cb_permissionGroup" ); + table + .foreignKey( "FK_authorID" ) + .references( "authorID" ) + .onTable( "cb_author" ); } ); - } function down( schema, query ){ diff --git a/modules/contentbox/migrations/init/create_author_permissions.cfc b/modules/contentbox/migrations/init/create_author_permissions.cfc index 91f22a016..7244c7907 100644 --- a/modules/contentbox/migrations/init/create_author_permissions.cfc +++ b/modules/contentbox/migrations/init/create_author_permissions.cfc @@ -1,15 +1,19 @@ component { - function up( schema, query ){ - - schema.create( "cb_authorPermissions", function(table) { + function up( schema, query ){ + schema.create( "cb_authorPermissions", function( table ){ table.string( "FK_permissionID", 36 ); table.string( "FK_authorID", 36 ); - table.foreignKey( "FK_permissionID" ).references( "permissionID" ).onTable( "cb_permission" ); - table.foreignKey( "FK_authorID" ).references( "authorID" ).onTable( "cb_author" ); + table + .foreignKey( "FK_permissionID" ) + .references( "permissionID" ) + .onTable( "cb_permission" ); + table + .foreignKey( "FK_authorID" ) + .references( "authorID" ) + .onTable( "cb_author" ); } ); - } function down( schema, query ){ diff --git a/modules/contentbox/migrations/init/create_category.cfc b/modules/contentbox/migrations/init/create_category.cfc index 02ab948f6..a7ab62725 100644 --- a/modules/contentbox/migrations/init/create_category.cfc +++ b/modules/contentbox/migrations/init/create_category.cfc @@ -1,8 +1,7 @@ component { - function up( schema, query ){ - - schema.create( "cb_category", function(table) { + function up( schema, query ){ + schema.create( "cb_category", function( table ){ // Base Columns table.string( "categoryID", 36 ).primaryKey(); table.datetime( "createdDate" ).withCurrent(); @@ -15,7 +14,10 @@ component { // Relationships table.string( "FK_siteID", 36 ); - table.foreignKey( "FK_siteID" ).references( "siteID" ).onTable( "cb_site" ); + table + .foreignKey( "FK_siteID" ) + .references( "siteID" ) + .onTable( "cb_site" ); // Index table.index( [ "isPublic" ], "idx_isPublic" ); @@ -23,7 +25,6 @@ component { table.index( [ "category" ], "idx_categoryName" ); table.index( [ "isDeleted" ], "idx_deleted" ); } ); - } function down( schema, query ){ diff --git a/modules/contentbox/migrations/init/create_comment_subscriptions.cfc b/modules/contentbox/migrations/init/create_comment_subscriptions.cfc index 3ee7fa7d5..8b58d74d9 100644 --- a/modules/contentbox/migrations/init/create_comment_subscriptions.cfc +++ b/modules/contentbox/migrations/init/create_comment_subscriptions.cfc @@ -1,15 +1,19 @@ component { - function up( schema, query ){ - - schema.create( "cb_commentSubscriptions", function(table) { + function up( schema, query ){ + schema.create( "cb_commentSubscriptions", function( table ){ table.string( "subscriptionID", 36 ); table.string( "FK_contentID", 36 ); - table.foreignKey( "subscriptionID" ).references( "subscriptionID" ).onTable( "cb_subscriptions" ); - table.foreignKey( "FK_contentID" ).references( "contentID" ).onTable( "cb_content" ); + table + .foreignKey( "subscriptionID" ) + .references( "subscriptionID" ) + .onTable( "cb_subscriptions" ); + table + .foreignKey( "FK_contentID" ) + .references( "contentID" ) + .onTable( "cb_content" ); } ); - } function down( schema, query ){ diff --git a/modules/contentbox/migrations/init/create_comments.cfc b/modules/contentbox/migrations/init/create_comments.cfc index 65a26ea14..a02511949 100644 --- a/modules/contentbox/migrations/init/create_comments.cfc +++ b/modules/contentbox/migrations/init/create_comments.cfc @@ -1,9 +1,7 @@ -component{ +component { function up( schema, query ){ - schema.create( "cb_comment", ( table ) => { - // Base Columns table.string( "commentID", 36 ).primaryKey(); table.datetime( "createdDate" ).withCurrent(); @@ -19,15 +17,16 @@ component{ // Relationships table.string( "FK_contentID", 36 ); - table.foreignKey( "FK_contentID" ).references( "contentID" ).onTable( "cb_content" ); + table + .foreignKey( "FK_contentID" ) + .references( "contentID" ) + .onTable( "cb_content" ); // Indexes table.index( [ "isApproved", "FK_contentID" ], "idx_contentComment" ); table.index( [ "isApproved" ], "idx_approved" ); table.index( [ "isDeleted" ], "idx_deleted" ); } ); - } - } diff --git a/modules/contentbox/migrations/init/create_content.cfc b/modules/contentbox/migrations/init/create_content.cfc index 03b04c44a..dafaaee8f 100644 --- a/modules/contentbox/migrations/init/create_content.cfc +++ b/modules/contentbox/migrations/init/create_content.cfc @@ -1,8 +1,7 @@ component { - function up( schema, query ){ - - schema.create( "cb_content", function(table) { + function up( schema, query ){ + schema.create( "cb_content", function( table ){ // Base Columns table.string( "contentID", 36 ).primaryKey(); table.datetime( "createdDate" ).withCurrent(); @@ -29,11 +28,20 @@ component { // Relationships table.string( "FK_siteID", 36 ); - table.foreignKey( "FK_siteID" ).references( "siteID" ).onTable( "cb_site" ); + table + .foreignKey( "FK_siteID" ) + .references( "siteID" ) + .onTable( "cb_site" ); table.string( "FK_authorID", 36 ); - table.foreignKey( "FK_authorID" ).references( "authorID" ).onTable( "cb_author" ); + table + .foreignKey( "FK_authorID" ) + .references( "authorID" ) + .onTable( "cb_author" ); table.string( "FK_parentID", 36 ).nullable(); - table.foreignKey( "FK_parentID" ).references( "contentID" ).onTable( "cb_content" ); + table + .foreignKey( "FK_parentID" ) + .references( "contentID" ) + .onTable( "cb_content" ); // Index table.index( [ "contentType" ], "idx_discriminator" ); @@ -48,7 +56,6 @@ component { table.index( [ "cacheLastAccessTimeout" ], "idx_cachelastaccesstimeout" ); table.index( [ "showInSearch" ], "idx_showInSearch" ); } ); - } function down( schema, query ){ diff --git a/modules/contentbox/migrations/init/create_contentStore.cfc b/modules/contentbox/migrations/init/create_contentStore.cfc index 21638cafa..a0f1dca26 100644 --- a/modules/contentbox/migrations/init/create_contentStore.cfc +++ b/modules/contentbox/migrations/init/create_contentStore.cfc @@ -1,16 +1,20 @@ component { - function up( schema, query ){ - - schema.create( "cb_contentStore", function(table) { + function up( schema, query ){ + schema.create( "cb_contentStore", function( table ){ table.string( "contentID", 36 ).primaryKey(); - table.integer( "order" ).default( 0 ).nullable(); + table + .integer( "order" ) + .default( 0 ) + .nullable(); table.string( "description", 500 ).nullable(); // Relationships - table.foreignKey( "contentID" ).references( "contentID" ).onTable( "cb_content" ); + table + .foreignKey( "contentID" ) + .references( "contentID" ) + .onTable( "cb_content" ); } ); - } function down( schema, query ){ diff --git a/modules/contentbox/migrations/init/create_content_categories.cfc b/modules/contentbox/migrations/init/create_content_categories.cfc index 63d528650..1f788b519 100644 --- a/modules/contentbox/migrations/init/create_content_categories.cfc +++ b/modules/contentbox/migrations/init/create_content_categories.cfc @@ -1,15 +1,19 @@ component { - function up( schema, query ){ - - schema.create( "cb_contentCategories", function(table) { + function up( schema, query ){ + schema.create( "cb_contentCategories", function( table ){ table.string( "FK_contentID", 36 ); table.string( "FK_categoryID", 36 ); - table.foreignKey( "FK_contentID" ).references( "contentID" ).onTable( "cb_content" ); - table.foreignKey( "FK_categoryID" ).references( "categoryID" ).onTable( "cb_category" ); + table + .foreignKey( "FK_contentID" ) + .references( "contentID" ) + .onTable( "cb_content" ); + table + .foreignKey( "FK_categoryID" ) + .references( "categoryID" ) + .onTable( "cb_category" ); } ); - } function down( schema, query ){ diff --git a/modules/contentbox/migrations/init/create_content_templates.cfc b/modules/contentbox/migrations/init/create_content_templates.cfc index 7f941a13e..6e53e1203 100644 --- a/modules/contentbox/migrations/init/create_content_templates.cfc +++ b/modules/contentbox/migrations/init/create_content_templates.cfc @@ -6,7 +6,6 @@ component { function up( schema, qb ){ schema.create( "cb_contentTemplate", ( table ) => { - // Base Columns table.string( "templateID", 36 ).primaryKey(); table.datetime( "createdDate" ).withCurrent(); @@ -21,9 +20,15 @@ component { // Relationships table.string( "FK_authorID", 36 ); - table.foreignKey( "FK_authorID" ).references( "authorID" ).onTable( "cb_author" ); + table + .foreignKey( "FK_authorID" ) + .references( "authorID" ) + .onTable( "cb_author" ); table.string( "FK_siteID", 36 ); - table.foreignKey( "FK_siteID" ).references( "siteID" ).onTable( "cb_site" ); + table + .foreignKey( "FK_siteID" ) + .references( "siteID" ) + .onTable( "cb_site" ); // Indexes table.index( [ "contentType" ], "idx_contentType" ); diff --git a/modules/contentbox/migrations/init/create_content_versions.cfc b/modules/contentbox/migrations/init/create_content_versions.cfc index c4e5ff389..1e50c9b9e 100644 --- a/modules/contentbox/migrations/init/create_content_versions.cfc +++ b/modules/contentbox/migrations/init/create_content_versions.cfc @@ -1,8 +1,7 @@ component { - function up( schema, query ){ - - schema.create( "cb_contentVersion", function(table) { + function up( schema, query ){ + schema.create( "cb_contentVersion", function( table ){ // Base Columns table.string( "contentVersionID", 36 ).primaryKey(); table.datetime( "createdDate" ).withCurrent(); @@ -16,9 +15,15 @@ component { // Relationships table.string( "FK_authorID", 36 ); - table.foreignKey( "FK_authorID" ).references( "authorID" ).onTable( "cb_author" ); + table + .foreignKey( "FK_authorID" ) + .references( "authorID" ) + .onTable( "cb_author" ); table.string( "FK_contentID", 36 ); - table.foreignKey( "FK_contentID" ).references( "contentID" ).onTable( "cb_content" ); + table + .foreignKey( "FK_contentID" ) + .references( "contentID" ) + .onTable( "cb_content" ); // Index table.index( [ "version" ], "idx_version" ); @@ -26,7 +31,6 @@ component { table.index( [ "FK_contentID", "isActive" ], "idx_contentVersions" ); table.index( [ "isActive" ], "idx_content_isActive" ); } ); - } function down( schema, query ){ diff --git a/modules/contentbox/migrations/init/create_custom_fields.cfc b/modules/contentbox/migrations/init/create_custom_fields.cfc index 793d84d11..6e4a2ebb0 100644 --- a/modules/contentbox/migrations/init/create_custom_fields.cfc +++ b/modules/contentbox/migrations/init/create_custom_fields.cfc @@ -1,9 +1,7 @@ -component{ +component { function up( schema, query ){ - schema.create( "cb_customfield", ( table ) => { - // Base Columns table.string( "customFieldID", 36 ).primaryKey(); table.datetime( "createdDate" ).withCurrent(); @@ -15,10 +13,11 @@ component{ // Relationships table.string( "FK_contentID", 36 ); - table.foreignKey( "FK_contentID" ).references( "contentID" ).onTable( "cb_content" ); + table + .foreignKey( "FK_contentID" ) + .references( "contentID" ) + .onTable( "cb_content" ); } ); - } - } diff --git a/modules/contentbox/migrations/init/create_entry.cfc b/modules/contentbox/migrations/init/create_entry.cfc index 1f7cb8281..b397f8b49 100644 --- a/modules/contentbox/migrations/init/create_entry.cfc +++ b/modules/contentbox/migrations/init/create_entry.cfc @@ -1,15 +1,16 @@ component { - function up( schema, query ){ - - schema.create( "cb_entry", function(table) { + function up( schema, query ){ + schema.create( "cb_entry", function( table ){ table.string( "contentID", 36 ).primaryKey(); table.longtext( "excerpt" ).nullable(); // Relationships - table.foreignKey( "contentID" ).references( "contentID" ).onTable( "cb_content" ); + table + .foreignKey( "contentID" ) + .references( "contentID" ) + .onTable( "cb_content" ); } ); - } function down( schema, query ){ diff --git a/modules/contentbox/migrations/init/create_group_permissions.cfc b/modules/contentbox/migrations/init/create_group_permissions.cfc index 7c35c52b1..82489a6b8 100644 --- a/modules/contentbox/migrations/init/create_group_permissions.cfc +++ b/modules/contentbox/migrations/init/create_group_permissions.cfc @@ -1,15 +1,19 @@ component { - function up( schema, query ){ - - schema.create( "cb_groupPermissions", function(table) { + function up( schema, query ){ + schema.create( "cb_groupPermissions", function( table ){ table.string( "FK_permissionGroupID", 36 ); table.string( "FK_permissionID", 36 ); - table.foreignKey( "FK_permissionGroupID" ).references( "permissionGroupID" ).onTable( "cb_permissionGroup" ); - table.foreignKey( "FK_permissionID" ).references( "permissionID" ).onTable( "cb_permission" ); + table + .foreignKey( "FK_permissionGroupID" ) + .references( "permissionGroupID" ) + .onTable( "cb_permissionGroup" ); + table + .foreignKey( "FK_permissionID" ) + .references( "permissionID" ) + .onTable( "cb_permission" ); } ); - } function down( schema, query ){ diff --git a/modules/contentbox/migrations/init/create_jwt.cfc b/modules/contentbox/migrations/init/create_jwt.cfc index a9675aa34..985c2fbe4 100644 --- a/modules/contentbox/migrations/init/create_jwt.cfc +++ b/modules/contentbox/migrations/init/create_jwt.cfc @@ -1,9 +1,7 @@ -component{ +component { function up( schema, query ){ - schema.create( "cb_jwt", ( table ) => { - // Base Columns table.string( "id", 36 ).primaryKey(); table.datetime( "expiration" ); @@ -15,8 +13,6 @@ component{ // Indexes table.index( [ "cacheKey" ], "idx_cacheKey" ); } ); - } - } diff --git a/modules/contentbox/migrations/init/create_login_attempts.cfc b/modules/contentbox/migrations/init/create_login_attempts.cfc index 68744e65c..ef5869bbd 100644 --- a/modules/contentbox/migrations/init/create_login_attempts.cfc +++ b/modules/contentbox/migrations/init/create_login_attempts.cfc @@ -1,9 +1,7 @@ -component{ +component { function up( schema, query ){ - schema.create( "cb_loginAttempts", ( table ) => { - // Base Columns table.string( "loginAttemptsID", 36 ).primaryKey(); table.datetime( "createdDate" ).withCurrent(); @@ -16,10 +14,7 @@ component{ // Index table.index( [ "value" ], "idx_values" ); - } ); - } - } diff --git a/modules/contentbox/migrations/init/create_menu_items.cfc b/modules/contentbox/migrations/init/create_menu_items.cfc index a694a2ac7..78e4a038d 100644 --- a/modules/contentbox/migrations/init/create_menu_items.cfc +++ b/modules/contentbox/migrations/init/create_menu_items.cfc @@ -1,9 +1,7 @@ -component{ +component { function up( schema, query ){ - schema.create( "cb_menuItem", ( table ) => { - // Base Columns table.string( "menuItemID", 36 ).primaryKey(); table.datetime( "createdDate" ).withCurrent(); @@ -26,17 +24,20 @@ component{ // Relationships table.string( "FK_menuID", 36 ); - table.foreignKey( "FK_menuID" ).references( "menuID" ).onTable( "cb_menu" ); + table + .foreignKey( "FK_menuID" ) + .references( "menuID" ) + .onTable( "cb_menu" ); table.string( "FK_parentID", 36 ); - table.foreignKey( "FK_parentID" ).references( "menuItemID" ).onTable( "cb_menuItem" ); + table + .foreignKey( "FK_parentID" ) + .references( "menuItemID" ) + .onTable( "cb_menuItem" ); // Index table.index( [ "title" ], "idx_menuItemTitle" ); table.index( [ "isDeleted" ], "idx_deleted" ); - } ); - } - } diff --git a/modules/contentbox/migrations/init/create_menus.cfc b/modules/contentbox/migrations/init/create_menus.cfc index 9ce9c282f..a98fedec9 100644 --- a/modules/contentbox/migrations/init/create_menus.cfc +++ b/modules/contentbox/migrations/init/create_menus.cfc @@ -1,9 +1,7 @@ -component{ +component { function up( schema, query ){ - schema.create( "cb_menu", ( table ) => { - // Base Columns table.string( "menuID", 36 ).primaryKey(); table.datetime( "createdDate" ).withCurrent(); @@ -18,15 +16,15 @@ component{ // Relationships table.string( "FK_siteID", 36 ); - table.foreignKey( "FK_siteID" ).references( "siteID" ).onTable( "cb_site" ); + table + .foreignKey( "FK_siteID" ) + .references( "siteID" ) + .onTable( "cb_site" ); // Index table.index( [ "title" ], "idx_menutitle" ); table.index( [ "slug" ], "idx_menuslug" ); - } ); - } - } diff --git a/modules/contentbox/migrations/init/create_modules.cfc b/modules/contentbox/migrations/init/create_modules.cfc index 8aca32282..5333735a3 100644 --- a/modules/contentbox/migrations/init/create_modules.cfc +++ b/modules/contentbox/migrations/init/create_modules.cfc @@ -1,9 +1,7 @@ -component{ +component { function up( schema, query ){ - schema.create( "cb_module", ( table ) => { - // Base Columns table.string( "moduleID", 36 ).primaryKey(); table.datetime( "createdDate" ).withCurrent(); @@ -28,8 +26,6 @@ component{ table.index( [ "moduleType" ], "idx_moduleType" ); table.index( [ "isDeleted" ], "idx_deleted" ); } ); - } - } diff --git a/modules/contentbox/migrations/init/create_page.cfc b/modules/contentbox/migrations/init/create_page.cfc index 794da4e9d..019b5b93e 100644 --- a/modules/contentbox/migrations/init/create_page.cfc +++ b/modules/contentbox/migrations/init/create_page.cfc @@ -1,18 +1,22 @@ component { - function up( schema, query ){ - - schema.create( "cb_page", function(table) { + function up( schema, query ){ + schema.create( "cb_page", function( table ){ table.string( "contentID", 36 ).primaryKey(); table.boolean( "showInMenu" ).default( true ); - table.integer( "order" ).default( 0 ).nullable(); + table + .integer( "order" ) + .default( 0 ) + .nullable(); table.longtext( "excerpt" ).nullable(); table.string( "layout", 200 ).nullable(); // Relationships - table.foreignKey( "contentID" ).references( "contentID" ).onTable( "cb_content" ); + table + .foreignKey( "contentID" ) + .references( "contentID" ) + .onTable( "cb_content" ); } ); - } function down( schema, query ){ diff --git a/modules/contentbox/migrations/init/create_permission_groups.cfc b/modules/contentbox/migrations/init/create_permission_groups.cfc index 54896aac1..205544d2e 100644 --- a/modules/contentbox/migrations/init/create_permission_groups.cfc +++ b/modules/contentbox/migrations/init/create_permission_groups.cfc @@ -1,8 +1,7 @@ component { - function up( schema, query ){ - - schema.create( "cb_permissionGroup", function(table) { + function up( schema, query ){ + schema.create( "cb_permissionGroup", function( table ){ // Base Columns table.string( "permissionGroupID", 36 ).primaryKey(); table.datetime( "createdDate" ).withCurrent(); @@ -12,7 +11,6 @@ component { table.string( "name" ).unique(); table.longText( "description" ).nullable(); } ); - } function down( schema, query ){ diff --git a/modules/contentbox/migrations/init/create_permissions.cfc b/modules/contentbox/migrations/init/create_permissions.cfc index e457cfb0d..b8dda8be6 100644 --- a/modules/contentbox/migrations/init/create_permissions.cfc +++ b/modules/contentbox/migrations/init/create_permissions.cfc @@ -1,8 +1,7 @@ component { - function up( schema, query ){ - - schema.create( "cb_permission", function(table) { + function up( schema, query ){ + schema.create( "cb_permission", function( table ){ // Base Columns table.string( "permissionID", 36 ).primaryKey(); table.datetime( "createdDate" ).withCurrent(); @@ -12,7 +11,6 @@ component { table.string( "permission" ).unique(); table.longText( "description" ).nullable(); } ); - } function down( schema, query ){ diff --git a/modules/contentbox/migrations/init/create_related_content.cfc b/modules/contentbox/migrations/init/create_related_content.cfc index 6f7a7ad0f..a64f04e01 100644 --- a/modules/contentbox/migrations/init/create_related_content.cfc +++ b/modules/contentbox/migrations/init/create_related_content.cfc @@ -1,15 +1,19 @@ component { - function up( schema, query ){ - - schema.create( "cb_relatedContent", function(table) { + function up( schema, query ){ + schema.create( "cb_relatedContent", function( table ){ table.string( "FK_contentID", 36 ); table.string( "FK_relatedContentID", 36 ); - table.foreignKey( "FK_contentID" ).references( "contentID" ).onTable( "cb_content" ); - table.foreignKey( "FK_relatedContentID" ).references( "contentID" ).onTable( "cb_content" ); + table + .foreignKey( "FK_contentID" ) + .references( "contentID" ) + .onTable( "cb_content" ); + table + .foreignKey( "FK_relatedContentID" ) + .references( "contentID" ) + .onTable( "cb_content" ); } ); - } function down( schema, query ){ diff --git a/modules/contentbox/migrations/init/create_relocations.cfc b/modules/contentbox/migrations/init/create_relocations.cfc index 38134b02c..a22bd4348 100644 --- a/modules/contentbox/migrations/init/create_relocations.cfc +++ b/modules/contentbox/migrations/init/create_relocations.cfc @@ -6,7 +6,6 @@ component { function up( schema, qb ){ schema.create( "cb_relocations", ( table ) => { - table.string( "relocationID", 36 ).primaryKey(); table.datetime( "createdDate" ).withCurrent(); table.datetime( "modifiedDate" ).withCurrent(); @@ -17,9 +16,15 @@ component { // Relationships table.string( "FK_siteID", 36 ); - table.foreignKey( "FK_siteID" ).references( "siteID" ).onTable( "cb_site" ); + table + .foreignKey( "FK_siteID" ) + .references( "siteID" ) + .onTable( "cb_site" ); table.string( "FK_contentID", 36 ).nullable(); - table.foreignKey( "FK_contentID" ).references( "contentID" ).onTable( "cb_content" ); + table + .foreignKey( "FK_contentID" ) + .references( "contentID" ) + .onTable( "cb_content" ); // Indexes table.unique( [ "slug", "FK_siteID" ] ); diff --git a/modules/contentbox/migrations/init/create_role_permissions.cfc b/modules/contentbox/migrations/init/create_role_permissions.cfc index 5d114ee83..396f1c87e 100644 --- a/modules/contentbox/migrations/init/create_role_permissions.cfc +++ b/modules/contentbox/migrations/init/create_role_permissions.cfc @@ -1,15 +1,19 @@ component { - function up( schema, query ){ - - schema.create( "cb_rolePermissions", function(table) { + function up( schema, query ){ + schema.create( "cb_rolePermissions", function( table ){ table.string( "FK_permissionID", 36 ); table.string( "FK_roleID", 36 ); - table.foreignKey( "FK_permissionID" ).references( "permissionID" ).onTable( "cb_permission" ); - table.foreignKey( "FK_roleID" ).references( "roleID" ).onTable( "cb_role" ); + table + .foreignKey( "FK_permissionID" ) + .references( "permissionID" ) + .onTable( "cb_permission" ); + table + .foreignKey( "FK_roleID" ) + .references( "roleID" ) + .onTable( "cb_role" ); } ); - } function down( schema, query ){ diff --git a/modules/contentbox/migrations/init/create_roles.cfc b/modules/contentbox/migrations/init/create_roles.cfc index 40288f440..143467548 100644 --- a/modules/contentbox/migrations/init/create_roles.cfc +++ b/modules/contentbox/migrations/init/create_roles.cfc @@ -1,8 +1,7 @@ component { - function up( schema, query ){ - - schema.create( "cb_role", function(table) { + function up( schema, query ){ + schema.create( "cb_role", function( table ){ // Base Columns table.string( "roleID", 36 ).primaryKey(); table.datetime( "createdDate" ).withCurrent(); @@ -12,7 +11,6 @@ component { table.string( "role" ).unique(); table.longText( "description" ).nullable(); } ); - } function down( schema, query ){ diff --git a/modules/contentbox/migrations/init/create_security_logs.cfc b/modules/contentbox/migrations/init/create_security_logs.cfc index 916115234..0aeed0a3b 100644 --- a/modules/contentbox/migrations/init/create_security_logs.cfc +++ b/modules/contentbox/migrations/init/create_security_logs.cfc @@ -1,9 +1,7 @@ -component{ +component { function up( schema, query ){ - schema.create( "cbsecurity_logs", ( table ) => { - // Base Columns table.string( "id", 36 ).primaryKey(); table.datetime( "logDate" ).withCurrent(); @@ -29,8 +27,6 @@ component{ table.index( [ "path" ], "idx_cbsecurity_path" ); table.index( [ "referer" ], "idx_cbsecurity_referer" ); } ); - } - } diff --git a/modules/contentbox/migrations/init/create_security_rules.cfc b/modules/contentbox/migrations/init/create_security_rules.cfc index c9f8bef83..963868b1b 100644 --- a/modules/contentbox/migrations/init/create_security_rules.cfc +++ b/modules/contentbox/migrations/init/create_security_rules.cfc @@ -1,9 +1,7 @@ -component{ +component { function up( schema, query ){ - schema.create( "cb_securityRule", ( table ) => { - // Base Columns table.string( "ruleID", 36 ).primaryKey(); table.datetime( "createdDate" ).withCurrent(); @@ -18,19 +16,29 @@ component{ table.string( "redirect", 500 ).nullable(); table.string( "overrideEvent", 500 ).nullable(); table.boolean( "useSSL" ).default( false ); - table.string( "action", 50 ).nullable().default( "redirect" ); + table + .string( "action", 50 ) + .nullable() + .default( "redirect" ); table.string( "module", 500 ).nullable(); - table.string( "httpMethods" ).nullable().default( "*" ); - table.string( "allowedIPs" ).nullable().default( "*" ); + table + .string( "httpMethods" ) + .nullable() + .default( "*" ); + table + .string( "allowedIPs" ) + .nullable() + .default( "*" ); table.integer( "order" ).default( 0 ); table.string( "message" ).nullable(); - table.string( "messageType", 50 ).nullable().default( "info" ); + table + .string( "messageType", 50 ) + .nullable() + .default( "info" ); // Indexes table.index( [ "isDeleted" ], "idx_deleted" ); } ); - } - } diff --git a/modules/contentbox/migrations/init/create_settings.cfc b/modules/contentbox/migrations/init/create_settings.cfc index 31037f4c2..cb9d5b332 100644 --- a/modules/contentbox/migrations/init/create_settings.cfc +++ b/modules/contentbox/migrations/init/create_settings.cfc @@ -1,9 +1,7 @@ -component{ +component { function up( schema, query ){ - schema.create( "cb_setting", ( table ) => { - // Base Columns table.string( "settingID", 36 ).primaryKey(); table.datetime( "createdDate" ).withCurrent(); @@ -16,13 +14,15 @@ component{ // Relationships table.string( "FK_siteID", 36 ).nullable(); - table.foreignKey( "FK_siteID" ).references( "siteID" ).onTable( "cb_site" ); + table + .foreignKey( "FK_siteID" ) + .references( "siteID" ) + .onTable( "cb_site" ); // Indexes table.index( [ "isCore" ], "idx_core" ); table.index( [ "isDeleted" ], "idx_deleted" ); } ); - } } diff --git a/modules/contentbox/migrations/init/create_sites.cfc b/modules/contentbox/migrations/init/create_sites.cfc index 139255741..1a4aaf209 100644 --- a/modules/contentbox/migrations/init/create_sites.cfc +++ b/modules/contentbox/migrations/init/create_sites.cfc @@ -1,7 +1,6 @@ -component{ +component { function up( schema, query ){ - schema.create( "cb_site", ( table ) => { // Base Columns table.string( "siteID", 36 ).primaryKey(); @@ -35,8 +34,6 @@ component{ table.index( [ "slug" ], "idx_siteSlug" ); table.index( [ "isDeleted" ], "idx_deleted" ); } ); - } - } diff --git a/modules/contentbox/migrations/init/create_stats.cfc b/modules/contentbox/migrations/init/create_stats.cfc index b48b78449..997a94684 100644 --- a/modules/contentbox/migrations/init/create_stats.cfc +++ b/modules/contentbox/migrations/init/create_stats.cfc @@ -1,8 +1,7 @@ component { - function up( schema, query ){ - - schema.create( "cb_stats", function(table) { + function up( schema, query ){ + schema.create( "cb_stats", function( table ){ // Base Columns table.string( "statsID", 36 ).primaryKey(); table.datetime( "createdDate" ).withCurrent(); @@ -13,12 +12,14 @@ component { // Relationships table.string( "FK_contentID", 36 ); - table.foreignKey( "FK_contentID" ).references( "contentID" ).onTable( "cb_content" ); + table + .foreignKey( "FK_contentID" ) + .references( "contentID" ) + .onTable( "cb_content" ); // Index table.index( [ "isDeleted" ], "idx_deleted" ); } ); - } function down( schema, query ){ diff --git a/modules/contentbox/migrations/init/create_subscribers.cfc b/modules/contentbox/migrations/init/create_subscribers.cfc index 279df84f9..69661f23f 100644 --- a/modules/contentbox/migrations/init/create_subscribers.cfc +++ b/modules/contentbox/migrations/init/create_subscribers.cfc @@ -1,9 +1,7 @@ -component{ +component { function up( schema, query ){ - schema.create( "cb_subscribers", ( table ) => { - // Base Columns table.string( "subscriberID", 36 ).primaryKey(); table.datetime( "createdDate" ).withCurrent(); @@ -17,8 +15,6 @@ component{ table.index( [ "subscriberEmail" ], "idx_subscriberEmail" ); table.index( [ "isDeleted" ], "idx_deleted" ); } ); - } - } diff --git a/modules/contentbox/migrations/init/create_subscriptions.cfc b/modules/contentbox/migrations/init/create_subscriptions.cfc index 674030401..0f89aa017 100644 --- a/modules/contentbox/migrations/init/create_subscriptions.cfc +++ b/modules/contentbox/migrations/init/create_subscriptions.cfc @@ -1,9 +1,7 @@ -component{ +component { function up( schema, query ){ - schema.create( "cb_subscriptions", ( table ) => { - // Base Columns table.string( "subscriptionID", 36 ).primaryKey(); table.datetime( "createdDate" ).withCurrent(); @@ -15,13 +13,14 @@ component{ // Relationships table.string( "FK_subscriberID", 36 ); - table.foreignKey( "FK_subscriberID" ).references( "subscriberID" ).onTable( "cb_subscribers" ); + table + .foreignKey( "FK_subscriberID" ) + .references( "subscriberID" ) + .onTable( "cb_subscribers" ); // Indexes table.index( [ "isDeleted" ], "idx_deleted" ); } ); - } - } diff --git a/modules/contentbox/migrations/init/create_users.cfc b/modules/contentbox/migrations/init/create_users.cfc index 2193fbe04..865002d8d 100644 --- a/modules/contentbox/migrations/init/create_users.cfc +++ b/modules/contentbox/migrations/init/create_users.cfc @@ -1,6 +1,7 @@ component { + function up( schema, query ){ - schema.create( "user", function(table) { + schema.create( "user", function( table ){ table.string( "userId" ).primaryKey(); table.string( "userType", 50 ); table.datetime( "createdDate" ).withCurrent(); @@ -16,7 +17,10 @@ component { table.string( "homePhone", 100 ).nullable(); table.date( "dob", 100 ).nullable(); table.string( "tshirtSize", 100 ).nullable(); - table.longText( "preferences" ).default( "" ).nullable(); + table + .longText( "preferences" ) + .default( "" ) + .nullable(); table.string( "facebookURL" ).nullable(); table.string( "twitterURL" ).nullable(); table.string( "blogURL" ).nullable(); @@ -25,7 +29,7 @@ component { table.tinyInteger( "isPasswordReset", 1 ).default( 1 ); table.longText( "biography" ).nullable(); table.string( "address" ).nullable(); - table.string( "city", 75 ).nullable(); + table.string( "city", 75 ).nullable(); table.string( "stateOrProvince" ).nullable(); table.string( "postalCode" ).nullable(); table.string( "country", 75 ); diff --git a/modules/contentbox/migrations/init/seed_permissions.cfc b/modules/contentbox/migrations/init/seed_permissions.cfc index eb1b92d0a..04708d64c 100644 --- a/modules/contentbox/migrations/init/seed_permissions.cfc +++ b/modules/contentbox/migrations/init/seed_permissions.cfc @@ -1,198 +1,199 @@ -component{ +component { function seed( schema, query ){ var perms = [ { - permission : "AUTHOR_ADMIN", + permission : "AUTHOR_ADMIN", description : "Ability to manage authors, default is view only" }, { - permission : "CATEGORIES_ADMIN", + permission : "CATEGORIES_ADMIN", description : "Ability to manage categories, default is view only" }, { - permission : "COMMENTS_ADMIN", + permission : "COMMENTS_ADMIN", description : "Ability to manage comments, default is view only" }, { - permission : "CONTENTBOX_ADMIN", + permission : "CONTENTBOX_ADMIN", description : "Access to the enter the ContentBox administrator console" }, { - permission : "CONTENTSTORE_ADMIN", + permission : "CONTENTSTORE_ADMIN", description : "Ability to manage the content store, default is view only" }, { - permission : "CONTENTSTORE_EDITOR", + permission : "CONTENTSTORE_EDITOR", description : "Ability to create, edit and publish content store elements" }, { - permission : "EDITORS_CACHING", + permission : "EDITORS_CACHING", description : "Ability to view the content caching panel" }, { - permission : "EDITORS_CATEGORIES", + permission : "EDITORS_CATEGORIES", description : "Ability to view the content categories panel" }, { - permission : "EDITORS_CUSTOM_FIELDS", + permission : "EDITORS_CUSTOM_FIELDS", description : "Ability to manage custom fields in any content editors" }, { - permission : "EDITORS_DISPLAY_OPTIONS", + permission : "EDITORS_DISPLAY_OPTIONS", description : "Ability to view the content display options panel" }, { - permission : "EDITORS_EDITOR_SELECTOR", + permission : "EDITORS_EDITOR_SELECTOR", description : "Ability to change the editor to another registered online editor" }, { - permission : "EDITORS_FEATURED_IMAGE", + permission : "EDITORS_FEATURED_IMAGE", description : "Ability to view the featured image panel" }, { - permission : "EDITORS_HTML_ATTRIBUTES", + permission : "EDITORS_HTML_ATTRIBUTES", description : "Ability to view the content HTML attributes panel" }, { - permission : "EDITORS_LINKED_CONTENT", + permission : "EDITORS_LINKED_CONTENT", description : "Ability to view the linked content panel" }, { - permission : "EDITORS_MODIFIERS", + permission : "EDITORS_MODIFIERS", description : "Ability to view the content modifiers panel" }, { - permission : "EDITORS_RELATED_CONTENT", + permission : "EDITORS_RELATED_CONTENT", description : "Ability to view the related content panel" }, { - permission : "EMAIL_TEMPLATE_ADMIN", + permission : "EMAIL_TEMPLATE_ADMIN", description : "Ability to admin and preview email templates" }, { - permission : "ENTRIES_ADMIN", + permission : "ENTRIES_ADMIN", description : "Ability to manage blog entries, default is view only" }, { - permission : "ENTRIES_EDITOR", + permission : "ENTRIES_EDITOR", description : "Ability to create, edit and publish blog entries" }, { - permission : "FORGEBOX_ADMIN", + permission : "FORGEBOX_ADMIN", description : "Ability to manage ForgeBox installations and connectivity." }, { - permission : "GLOBAL_SEARCH", + permission : "GLOBAL_SEARCH", description : "Ability to do global searches in the ContentBox Admin" }, { - permission : "GLOBALHTML_ADMIN", + permission : "GLOBALHTML_ADMIN", description : "Ability to manage the system's global HTML content used on layouts" }, { - permission : "MEDIAMANAGER_ADMIN", + permission : "MEDIAMANAGER_ADMIN", description : "Ability to manage the system's media manager" }, { - permission : "MEDIAMANAGER_LIBRARY_SWITCHER", + permission : "MEDIAMANAGER_LIBRARY_SWITCHER", description : "Ability to switch media manager libraries for management" }, { - permission : "MENUS_ADMIN", + permission : "MENUS_ADMIN", description : "Ability to manage the menu builder" }, { - permission : "MODULES_ADMIN", + permission : "MODULES_ADMIN", description : "Ability to manage ContentBox Modules" }, { - permission : "PAGES_ADMIN", + permission : "PAGES_ADMIN", description : "Ability to manage content pages, default is view only" }, { - permission : "PAGES_EDITOR", + permission : "PAGES_EDITOR", description : "Ability to create, edit and publish pages" }, { - permission : "PERMISSIONS_ADMIN", + permission : "PERMISSIONS_ADMIN", description : "Ability to manage permissions, default is view only" }, { - permission : "RELOAD_MODULES", + permission : "RELOAD_MODULES", description : "Ability to reload modules" }, { - permission : "RELOAD_CACHES", + permission : "RELOAD_CACHES", description : "Ability to reload caches" }, { - permission : "ROLES_ADMIN", + permission : "ROLES_ADMIN", description : "Ability to manage roles, default is view only" }, { - permission : "SECURITYRULES_ADMIN", + permission : "SECURITYRULES_ADMIN", description : "Ability to manage the system's security rules, default is view only" }, { - permission : "SITES_ADMIN", + permission : "SITES_ADMIN", description : "Ability to manage sites" }, { - permission : "SYSTEM_AUTH_LOGS", + permission : "SYSTEM_AUTH_LOGS", description : "Access to the system auth logs" }, { - permission : "SYSTEM_RAW_SETTINGS", + permission : "SYSTEM_RAW_SETTINGS", description : "Access to the ContentBox raw geek settings panel" }, { - permission : "SYSTEM_SAVE_CONFIGURATION", + permission : "SYSTEM_SAVE_CONFIGURATION", description : "Ability to update global configuration data" }, { - permission : "SYSTEM_TAB", + permission : "SYSTEM_TAB", description : "Access to the ContentBox System tools" }, { - permission : "SYSTEM_UPDATES", + permission : "SYSTEM_UPDATES", description : "Ability to view and apply ContentBox updates" }, { - permission : "THEME_ADMIN", + permission : "THEME_ADMIN", description : "Ability to manage layouts, default is view only" }, { - permission : "TOOLS_EXPORT", + permission : "TOOLS_EXPORT", description : "Ability to export data from ContentBox" }, { - permission : "TOOLS_IMPORT", + permission : "TOOLS_IMPORT", description : "Ability to import data into ContentBox" }, { - permission : "VERSIONS_DELETE", + permission : "VERSIONS_DELETE", description : "Ability to delete past content versions" }, { - permission : "VERSIONS_ROLLBACK", + permission : "VERSIONS_ROLLBACK", description : "Ability to rollback content versions" }, { - permission : "WIDGET_ADMIN", + permission : "WIDGET_ADMIN", description : "Ability to manage widgets, default is view only" } ]; perms = perms.map( ( thisPerm ) => { thisPerm.permissionID = createUUID(); - thisPerm.isDeleted = 0; - thisPerm.createdDate = thisPerm.modifiedDate = now(); + thisPerm.isDeleted = 0; + thisPerm.createdDate = thisPerm.modifiedDate = now(); return thisPerm; } ); - query.newQuery() - .from( "cb_permission") + query + .newQuery() + .from( "cb_permission" ) .insert( perms ); systemOutput( "√ Permissions seeded", true ); diff --git a/modules/contentbox/migrations/init/seed_roles.cfc b/modules/contentbox/migrations/init/seed_roles.cfc index ee889008e..1ac61b4b4 100644 --- a/modules/contentbox/migrations/init/seed_roles.cfc +++ b/modules/contentbox/migrations/init/seed_roles.cfc @@ -1,39 +1,42 @@ -component{ +component { function seed( schema, query ){ var admin = { - roleID : createUUID(), - isDeleted : 0, - createdDate : now(), + roleID : createUUID(), + isDeleted : 0, + createdDate : now(), modifiedDate : now(), - role: "Administrator", - description: "A ContentBox Administrator" + role : "Administrator", + description : "A ContentBox Administrator" }; var editor = { - roleID : createUUID(), - isDeleted : 0, - createdDate : now(), + roleID : createUUID(), + isDeleted : 0, + createdDate : now(), modifiedDate : now(), - role: "Editor", - description: "A ContentBox Editor" + role : "Editor", + description : "A ContentBox Editor" }; // ADMIN ROLE - query.newQuery() - .from( "cb_role") + query + .newQuery() + .from( "cb_role" ) .insert( admin ); - var allPerms = query.newQuery() + var allPerms = query + .newQuery() .from( "cb_permission" ) .get(); allPerms.each( ( record ) => { - query.newQuery() + query + .newQuery() .from( "cb_rolePermissions" ) .insert( { FK_permissionID : record.permissionID, - FK_roleID : admin.roleID + FK_roleID : admin.roleID } ); } ); @@ -41,8 +44,9 @@ component{ // EDITOR ROLE - query.newQuery() - .from( "cb_role") + query + .newQuery() + .from( "cb_role" ) .insert( editor ); var editorPerms = [ @@ -73,16 +77,19 @@ component{ "VERSIONS_ROLLBACK" ]; - allPerms.filter( ( record ) => { - return editorPerms.contains( record.permission ); - } ).each( ( record ) => { - query.newQuery() - .from( "cb_rolePermissions" ) - .insert( { - FK_permissionID : record.permissionID, - FK_roleID : editor.roleID - } ); - } ); + allPerms + .filter( ( record ) => { + return editorPerms.contains( record.permission ); + } ) + .each( ( record ) => { + query + .newQuery() + .from( "cb_rolePermissions" ) + .insert( { + FK_permissionID : record.permissionID, + FK_roleID : editor.roleID + } ); + } ); systemOutput( "√ Editor role created", true ); systemOutput( "√ Roles seeded", true ); diff --git a/modules/contentbox/models/BaseEntityMethods.cfc b/modules/contentbox/models/BaseEntityMethods.cfc index 6fa6f9864..a724f3375 100644 --- a/modules/contentbox/models/BaseEntityMethods.cfc +++ b/modules/contentbox/models/BaseEntityMethods.cfc @@ -113,7 +113,11 @@ component { * @profile The profile to append to: export, import, etc. * @target The target to append to: defaultIncludes, defaultExcludes, neverInclude, defaults, etc. */ - function appendToMementoProfile( required collection, required profile, target = "defaultIncludes" ){ + function appendToMementoProfile( + required collection, + required profile, + target = "defaultIncludes" + ){ var filtered = arguments.collection.filter( function( item ){ return !arrayContainsNoCase( this.memento.profiles[ profile ][ target ], arguments.item ); } ); diff --git a/modules/contentbox/models/content/ContentService.cfc b/modules/contentbox/models/content/ContentService.cfc index 2d8711938..dfbcd7c3f 100755 --- a/modules/contentbox/models/content/ContentService.cfc +++ b/modules/contentbox/models/content/ContentService.cfc @@ -830,7 +830,7 @@ component extends="cborm.models.VirtualEntityService" singleton { var thisContent = arguments.contentData; // Get content by slug, if not found then it returns a new entity so we can persist it. - var oContent = findWhere( { "slug" : thisContent.slug, "site" : arguments.site } ); + var oContent = findWhere( { "slug" : thisContent.slug, "site" : arguments.site } ); if ( isNull( oContent ) ) { logThis( "! Content (#thisContent.contentType#:#thisContent.slug#) not found in site, proceeding to import as new content." diff --git a/modules/contentbox/models/content/ContentStore.cfc b/modules/contentbox/models/content/ContentStore.cfc index 851cb3a55..ab41c611e 100755 --- a/modules/contentbox/models/content/ContentStore.cfc +++ b/modules/contentbox/models/content/ContentStore.cfc @@ -54,7 +54,7 @@ component ********************************************************************* */ function init(){ - var props = [ "description", "order" ]; + var props = [ "description", "order" ]; appendToMemento( props, "defaultIncludes" ); appendToMemento( [], "defaultExcludes" ); appendToMementoProfile( props, "export" ); diff --git a/modules/contentbox/modules/contentbox-api/modules/contentbox-api-v1/handlers/categories.cfc b/modules/contentbox/modules/contentbox-api/modules/contentbox-api-v1/handlers/categories.cfc index 8351ba735..1d43a6640 100644 --- a/modules/contentbox/modules/contentbox-api/modules/contentbox-api-v1/handlers/categories.cfc +++ b/modules/contentbox/modules/contentbox-api/modules/contentbox-api-v1/handlers/categories.cfc @@ -56,9 +56,9 @@ component extends="baseHandler" { /** * Create a category * - * @tags Categories - * @requestBody contentbox/apidocs/categories/create/requestBody.json - * @responses contentbox/apidocs/categories/create/responses.json + * @tags Categories + * @requestBody contentbox/apidocs/categories/create/requestBody.json + * @responses contentbox/apidocs/categories/create/responses.json * @x-contentbox-permissions CATEGORIES_ADMIN */ function create( event, rc, prc ) secured="CATEGORIES_ADMIN"{ diff --git a/modules/contentbox/modules/contentbox-api/modules/contentbox-api-v1/handlers/contentStore.cfc b/modules/contentbox/modules/contentbox-api/modules/contentbox-api-v1/handlers/contentStore.cfc index ffa57410d..d7231bc07 100644 --- a/modules/contentbox/modules/contentbox-api/modules/contentbox-api-v1/handlers/contentStore.cfc +++ b/modules/contentbox/modules/contentbox-api/modules/contentbox-api-v1/handlers/contentStore.cfc @@ -41,10 +41,10 @@ component extends="baseContentHandler" { // If passed, we can do a slug wildcard search param rc.slugSearch = ""; // If passed, it's a slug operation - param rc.slug = ""; + param rc.slug = ""; // If we have a `slug` then we treat it as a /:slug route, due to hierarchical paths - if( rc.slug.trim().length() > 0 ){ + if ( rc.slug.trim().length() > 0 ) { rc.id = rc.slug; return show( argumentCollection = arguments ); } @@ -94,9 +94,9 @@ component extends="baseContentHandler" { /** * Create a content store item * - * @tags ContentStore - * @requestBody contentbox/apidocs/contentStore/create/requestBody.json - * @responses contentbox/apidocs/contentStore/create/responses.json + * @tags ContentStore + * @requestBody contentbox/apidocs/contentStore/create/requestBody.json + * @responses contentbox/apidocs/contentStore/create/responses.json * @x-contentbox-permissions CONTENTSTORE_ADMIN,CONTENTSTORE_EDITOR */ function create( event, rc, prc ) secured="CONTENTSTORE_ADMIN,CONTENTSTORE_EDITOR"{ diff --git a/modules/contentbox/modules/contentbox-api/modules/contentbox-api-v1/handlers/contentTemplates.cfc b/modules/contentbox/modules/contentbox-api/modules/contentbox-api-v1/handlers/contentTemplates.cfc index f25eaab46..7a7f203f5 100644 --- a/modules/contentbox/modules/contentbox-api/modules/contentbox-api-v1/handlers/contentTemplates.cfc +++ b/modules/contentbox/modules/contentbox-api/modules/contentbox-api-v1/handlers/contentTemplates.cfc @@ -59,7 +59,7 @@ component extends="baseHandler" { /** * Create a template * - * @tags Templates + * @tags Templates * @x-contentbox-permissions PAGES_ADMIN */ function create( event, rc, prc ) secured="PAGES_ADMIN"{ @@ -71,7 +71,7 @@ component extends="baseHandler" { /** * Update an existing template * - * @tags Templates + * @tags Templates * @x-contentbox-permissions PAGES_ADMIN */ function update( event, rc, prc ) secured="PAGES_ADMIN"{ @@ -83,7 +83,7 @@ component extends="baseHandler" { /** * Delete a template using an id or name * - * @tags Templates + * @tags Templates * @x-contentbox-permissions PAGES_ADMIN */ function delete( event, rc, prc ) secured="PAGES_ADMIN"{ diff --git a/modules/contentbox/modules/contentbox-api/modules/contentbox-api-v1/handlers/entries.cfc b/modules/contentbox/modules/contentbox-api/modules/contentbox-api-v1/handlers/entries.cfc index 027572309..d858d79c3 100644 --- a/modules/contentbox/modules/contentbox-api/modules/contentbox-api-v1/handlers/entries.cfc +++ b/modules/contentbox/modules/contentbox-api/modules/contentbox-api-v1/handlers/entries.cfc @@ -76,9 +76,9 @@ component extends="baseContentHandler" { /** * Create an entry * - * @tags Entries - * @requestBody contentbox/apidocs/entries/create/requestBody.json - * @responses contentbox/apidocs/entries/create/responses.json + * @tags Entries + * @requestBody contentbox/apidocs/entries/create/requestBody.json + * @responses contentbox/apidocs/entries/create/responses.json * @x-contentbox-permissions ENTRIES_ADMIN,ENTRIES_EDITOR */ function create( event, rc, prc ) secured="ENTRIES_ADMIN,ENTRIES_EDITOR"{ diff --git a/modules/contentbox/modules/contentbox-api/modules/contentbox-api-v1/handlers/menus.cfc b/modules/contentbox/modules/contentbox-api/modules/contentbox-api-v1/handlers/menus.cfc index d7a516969..ac6987fbd 100644 --- a/modules/contentbox/modules/contentbox-api/modules/contentbox-api-v1/handlers/menus.cfc +++ b/modules/contentbox/modules/contentbox-api/modules/contentbox-api-v1/handlers/menus.cfc @@ -59,9 +59,9 @@ component extends="baseHandler" secured="MENUS_ADMIN" { /** * Create a menu * - * @tags Menus - * @requestBody contentbox/apidocs/menus/create/requestBody.json - * @responses contentbox/apidocs/menus/create/responses.json + * @tags Menus + * @requestBody contentbox/apidocs/menus/create/requestBody.json + * @responses contentbox/apidocs/menus/create/responses.json * @x-contentbox-permissions MENUS_ADMIN */ function create( event, rc, prc ){ diff --git a/modules/contentbox/modules/contentbox-api/modules/contentbox-api-v1/handlers/pages.cfc b/modules/contentbox/modules/contentbox-api/modules/contentbox-api-v1/handlers/pages.cfc index 9d66ee1dd..595590a8d 100644 --- a/modules/contentbox/modules/contentbox-api/modules/contentbox-api-v1/handlers/pages.cfc +++ b/modules/contentbox/modules/contentbox-api/modules/contentbox-api-v1/handlers/pages.cfc @@ -40,10 +40,10 @@ component extends="baseContentHandler" { // If passed, this will do a hierarchical search according to this slug prefix. Remember that all hierarchical content's slug field contains its hierarchy: /products/awesome/product1. This prefix will be appended with a `/` param rc.slugPrefix = ""; // If passed, it's a slug operation - param rc.slug = ""; + param rc.slug = ""; // If we have a `slug` then we treat it as a /:slug route, due to hierarchical paths - if( rc.slug.trim().length() > 0 ){ + if ( rc.slug.trim().length() > 0 ) { rc.id = rc.slug; return show( argumentCollection = arguments ); } @@ -98,9 +98,9 @@ component extends="baseContentHandler" { /** * Create a page * - * @tags Pages - * @requestBody contentbox/apidocs/pages/create/requestBody.json - * @responses contentbox/apidocs/pages/create/responses.json + * @tags Pages + * @requestBody contentbox/apidocs/pages/create/requestBody.json + * @responses contentbox/apidocs/pages/create/responses.json * @x-contentbox-permissions PAGES_ADMIN,PAGES_EDITOR */ function create( event, rc, prc ) secured="PAGES_ADMIN,PAGES_EDITOR"{ diff --git a/modules/contentbox/modules/contentbox-api/modules/contentbox-api-v1/handlers/relocations.cfc b/modules/contentbox/modules/contentbox-api/modules/contentbox-api-v1/handlers/relocations.cfc index dd2b5cedb..af7fd37af 100644 --- a/modules/contentbox/modules/contentbox-api/modules/contentbox-api-v1/handlers/relocations.cfc +++ b/modules/contentbox/modules/contentbox-api/modules/contentbox-api-v1/handlers/relocations.cfc @@ -66,9 +66,9 @@ component extends="baseHandler" secured="PAGES_ADMIN,PAGES_EDITOR" { /** * Create a relocation * - * @tags relocations - * @requestBody contentbox/apidocs/relocations/create/requestBody.json - * @responses contentbox/apidocs/relocations/create/responses.json + * @tags relocations + * @requestBody contentbox/apidocs/relocations/create/requestBody.json + * @responses contentbox/apidocs/relocations/create/responses.json * @x-contentbox-permissions relocations_ADMIN */ function create( event, rc, prc ){ diff --git a/modules/contentbox/modules/contentbox-api/modules/contentbox-api-v1/handlers/sites.cfc b/modules/contentbox/modules/contentbox-api/modules/contentbox-api-v1/handlers/sites.cfc index b68d06e0c..f6829ee06 100644 --- a/modules/contentbox/modules/contentbox-api/modules/contentbox-api-v1/handlers/sites.cfc +++ b/modules/contentbox/modules/contentbox-api/modules/contentbox-api-v1/handlers/sites.cfc @@ -61,9 +61,9 @@ component extends="baseHandler" secured="SITES_ADMIN" { /** * Create a site * - * @tags Sites - * @requestBody contentbox/apidocs/sites/create/requestBody.json - * @responses contentbox/apidocs/sites/create/responses.json + * @tags Sites + * @requestBody contentbox/apidocs/sites/create/requestBody.json + * @responses contentbox/apidocs/sites/create/responses.json * @x-contentbox-permissions SITES_ADMIN */ function create( event, rc, prc ){ diff --git a/package-lock.json b/package-lock.json index fa3aa43a2..6cc7587bd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "name": "contentbox-cms", "version": "1.0.0", "dependencies": { - "@alpinejs/focus": "^3.13.1", + "@alpinejs/focus": "^3.13.3", "@alpinejs/ui": "^3.10.4-beta.5", "@fortawesome/fontawesome-free": "^5.15.4", "@popperjs/core": "^2.11.8", @@ -72,9 +72,9 @@ } }, "node_modules/@alpinejs/focus": { - "version": "3.13.2", - "resolved": "https://registry.npmjs.org/@alpinejs/focus/-/focus-3.13.2.tgz", - "integrity": "sha512-lepXGG/mHy5/SpqFFx4lMt/PN0FRYx9YFv/D32w/xPqN+FpmWSBJvXtPJBMyWPcaDF/4dfa0CQT4Se7mMikp4A==", + "version": "3.13.3", + "resolved": "https://registry.npmjs.org/@alpinejs/focus/-/focus-3.13.3.tgz", + "integrity": "sha512-fTRX/9wOfysyZ1PJ4gHeUnmiNTIgqBDIqKxeP5iMvj1UHD3TFLDXllvoIKH3ezqcsyQZqxd/q1MFM7dlIhkmeg==", "dependencies": { "focus-trap": "^6.9.4", "tabbable": "^5.3.3" diff --git a/package.json b/package.json index b9456c5e1..2c43f92a1 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "webpack-cli": "^4.9.2" }, "dependencies": { - "@alpinejs/focus": "^3.13.1", + "@alpinejs/focus": "^3.13.3", "@alpinejs/ui": "^3.10.4-beta.5", "@fortawesome/fontawesome-free": "^5.15.4", "@popperjs/core": "^2.11.8", diff --git a/tests/resources/seeds/TestFixtures.cfc b/tests/resources/seeds/TestFixtures.cfc index 4833cade4..fd72abebd 100644 --- a/tests/resources/seeds/TestFixtures.cfc +++ b/tests/resources/seeds/TestFixtures.cfc @@ -4,10 +4,9 @@ * * This is run usually after the initial migrations have ran! */ -component{ +component { function run( qb, mockData ){ - } }