Skip to content

Commit

Permalink
v5.1.2 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
lmajano committed Mar 31, 2022
2 parents 453c42a + 1b76212 commit c6997e2
Show file tree
Hide file tree
Showing 9 changed files with 118 additions and 32 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
name: Pull Requests

on:
push:
branches-ignore:
- "main"
- "master"
- "development"
pull_request:
branches:
- development
Expand Down
2 changes: 1 addition & 1 deletion box.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name":"ContentBox Tester Site",
"version":"5.1.1",
"version":"5.2.0",
"author":"Ortus Solutions <[email protected]>",
"shortDescription":"A tester site for developing the ContentBox Modular CMS",
"type":"cms",
Expand Down
32 changes: 12 additions & 20 deletions build/patches/5.0.0/Updater.cfc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Update a v4 Installation to v5.0.0
* Update a v4 Installation to v5
*/
component {

Expand All @@ -8,7 +8,7 @@ component {
variables.cwd = getCWD();
variables.tempFolder = variables.cwd & "__temp";

variables.targetVersion = "5.0.0";
variables.targetVersion = "5";

if( directoryExists( variables.tempFolder ) ){
directoryDelete( variables.tempFolder, true );
Expand Down Expand Up @@ -54,26 +54,13 @@ component {
return;
}

// install contentbox-site so we can copy over new assets and run our migrations
// Install ContentBox
print.blueLine( "Downloading ContentBox v#variables.targetVersion# assets to __temp folder..." ).toConsole();
command( "install contentbox-site@#variables.targetVersion#" )
.inWorkingDirectory( variables.tempFolder )
.run();
print.greenLine( "√ ContentBox assets downloaded!" ).toConsole();

// Copy over migration resources
print.blueLine( "Installing new ContentBox resources folder..." ).toConsole();
if( !directoryExists( variables.cwd & "resources" ) ){
directoryCreate( variables.cwd & "resources" );
};
copy( variables.tempFolder & "/resources", variables.cwd & "resources" );
print.greenLine( "√ ContentBox resources installed!" ).toConsole();

// Run Migrations
print.blueLine( "Migrating your database to version: #variables.targetVersion#..." ).toConsole();
command( "run-script contentbox:migrate:up" ).run();
print.greenLine( "√ Database migrated! Let's do some code now." ).toConsole();

// Update ColdBox
print.blueLine( "Uninstalling current version of ColdBox..." ).toConsole();
command( "uninstall coldbox" ).run();
Expand All @@ -84,7 +71,7 @@ component {
// Update ContentBox
print.blueLine( "Uninstalling current version of the ContentBox module..." ).toConsole();
command( "uninstall contentbox" ).run();
print.blueLine( "Installing ContentBox v5.0.0" ).toConsole();
print.blueLine( "Installing ContentBox v#variables.targetVersion#" ).toConsole();
command( "install contentbox@#variables.targetVersion# --save" ).run();
print.greenLine( "√ ContentBox v5 Installed!" ).toConsole();

Expand All @@ -97,19 +84,24 @@ component {
print.greenLine( "√ New ContentBox bin folder installed!" ).toConsole();

// Copy over new files
replaceNewFiles();
replaceNewSiteFiles();

// Remove temp folder
directoryDelete( variables.tempFolder, true );

// Run Migrations
print.blueLine( "Migrating your database to version: #variables.targetVersion#..." ).toConsole();
command( "run-script contentbox:migrate:up" ).run();
print.greenLine( "√ Database migrated! Let's do some code now." ).toConsole();

// Final Comment
print.boldRedLine(
"√ Eureka! You are now ready to startup your engines and run ContentBox v5.0.0!"
"√ Eureka! You are now ready to startup your engines and run ContentBox v#variables.targetVersion#!"
)
.toConsole();
}

function replaceNewFiles(){
function replaceNewSiteFiles(){
print.blueLine( "Starting to deploy new files..." ).line().toConsole();

var files = [
Expand Down
11 changes: 10 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

----

## [5.1.2] => 2022-MAR-31

### Fixed

- [CONTENTBOX-1415](https://ortussolutions.atlassian.net/browse/CONTENTBOX-1415) 5.x Updater was not running the right migrations
- [CONTENTBOX-1414](https://ortussolutions.atlassian.net/browse/CONTENTBOX-1414) Migration names cannot have a period or the migrations fail due to a CFC instantiation issue
- [CONTENTBOX-1413](https://ortussolutions.atlassian.net/browse/CONTENTBOX-1413) CBHelper siteBaseURL is not accounting for multi-site

----

## [5.1.1] => 2022-MAR-17

### Fixed
Expand All @@ -18,7 +28,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [CONTENTBOX-1412](https://ortussolutions.atlassian.net/browse/CONTENTBOX-1412) VerifyPageLayout\(\) on the page rendering touches the filesystem on each request, removing this as it is not needed
- [CONTENTBOX-1368](https://ortussolutions.atlassian.net/browse/CONTENTBOX-1368) rc.pageUri is only the first segment of the actual slug, now it contains the full hierarchical slug


----

## [5.1.0] => 2022-MAR-17
Expand Down
7 changes: 7 additions & 0 deletions config/Coldbox.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,13 @@ component {
};
}

/**
* Testing Mode.
*/
function testing(){
development();
}

/**
* Development environment
* ORTUS DEVELOPMENT ENVIRONMENT, REMOVE FOR YOUR APP IF NEEDED
Expand Down
25 changes: 21 additions & 4 deletions modules/contentbox/models/system/CBHelper.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ component accessors="true" singleton threadSafe {
*/
any function setting( required key, defaultValue ){
var prc = getPrivateRequestCollection();

// See if all the settings are loaded, else lazy load them
if( isNull( prc.cbSettings ) || structIsEmpty( prc.cbSettings ) ){
prc.cbSettings = variables.settingService.getAllSettings();
}

// return setting if it exists
if ( structKeyExists( prc.cbSettings, arguments.key ) ) {
return prc.cbSettings[ key ];
Expand Down Expand Up @@ -128,6 +134,11 @@ component accessors="true" singleton threadSafe {
any function siteSetting( required key, defaultValue ){
var prc = getPrivateRequestCollection();

// See if all the settings are loaded, else lazy load them
if( isNull( prc.cbSiteSettings ) || structIsEmpty( prc.cbSiteSettings ) ){
prc.cbSiteSettings = variables.settingService.getAllSiteSettings( prc.oCurrentSite.getSlug() );
}

// return setting if it exists
if ( structKeyExists( prc.cbSiteSettings, arguments.key ) ) {
return prc.cbSiteSettings[ key ];
Expand Down Expand Up @@ -298,14 +309,20 @@ component accessors="true" singleton threadSafe {
*/
function siteRoot( string siteID = "" ){
// Return the appropriate site Uri
return this.site( arguments.siteID ).getSiteRoot() & getPrivateRequestCollection().cbEntryPoint;
return this.site( arguments.siteID ).getSiteRoot() & getModuleConfig( "contentbox-ui" ).entryPoint;
}

/**
* Get the site base html ref URL
* Get the HTML base URL that is used for the HTML <base> tag. This also accounts for SSL or not.
*
* @siteID The site id to get the root from, by default we use the current site you are on
*/
function siteBaseURL(){
return getRequestContext().getHTMLBaseUrl();
function siteBaseURL( string siteID = "" ){
return reReplaceNoCase(
this.siteRoot( arguments.siteID ),
"index.cfm\/?",
""
);
}

/**
Expand Down
7 changes: 6 additions & 1 deletion tests/Application.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ component{
// Turn on/off remote cfc content whitespace
this.suppressRemoteComponentContent = false;

/**************************************
TESTING ENV
**************************************/
createObject( "java", "java.lang.System" ).setProperty( "ENVIRONMENT", "testing" );

// FILL OUT: THE LOCATION OF THE CONTENTBOX MODULE
rootPath = replacenocase( replacenocase( getDirectoryFromPath( getCurrentTemplatePath() ), "tests\", "" ), "tests/", "" );

Expand Down Expand Up @@ -89,4 +94,4 @@ component{

}

}
}
61 changes: 61 additions & 0 deletions tests/specs/contentbox-web/contentbox/unit/system/CBHelperTest.cfc
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/**
* ContentBox - A Modular Content Platform
* Copyright since 2012 by Ortus Solutions, Corp
* www.ortussolutions.com/products/contentbox
* ---
*/
component extends="tests.resources.BaseTest" {

/*********************************** BDD SUITES ***********************************/

function run( testResults, testBox ){
describe( "CB Helper", function(){
beforeEach( function( currentSpec ){
setup();
cbHelper = getInstance( "CBHelper@contentbox" );
} );

it( "can be created", function(){
expect( cbHelper ).toBeComponent();
} );

describe( "Site related methods", function(){
it( "can build the site root", function(){
expect( cbHelper.siteRoot() ).toInclude( "http://127.0.0.1" );
});

it( "can build the site base url", function(){
expect( cbHelper.siteBaseUrl() )
.toInclude( "http://127.0.0.1" )
.notToInclude( "index.cfm" );
});

it( "can build the site name", function(){
expect( cbHelper.siteName() ).toInclude( "Default Site" );
});

it( "can build the site tag line", function(){
expect( cbHelper.siteTagLine() ).notToBeEmpty();
});

it( "can build the site description", function(){
expect( cbHelper.siteDescription() ).notToBeEmpty();
});

it( "can build the site keywords", function(){
cbHelper.siteKeywords();
});

it( "can build the site email", function(){
expect( cbHelper.siteEmail() ).notToBeEmpty();
});

it( "can build the site outgoing email", function(){
expect( cbHelper.siteOutgoingEmail() ).notToBeEmpty();
});
});

} );
}

}

0 comments on commit c6997e2

Please sign in to comment.