Skip to content

Commit

Permalink
Merge branch 'hotfix-10.8.53' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
sebduggan committed Oct 26, 2017
2 parents d188cd0 + 4678a97 commit befe87e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
2 changes: 2 additions & 0 deletions system/handlers/admin/DataManager.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -1643,6 +1643,7 @@
<cfargument name="successUrl" type="string" required="false" default="#( successAction.len() ? event.buildAdminLink( linkTo=successAction, queryString='id={newid}' ) : event.buildAdminLink( linkTo="datamanager.object", querystring="id=#arguments.object#" ) )#" />
<cfargument name="redirectOnSuccess" type="boolean" required="false" default="true" />
<cfargument name="formName" type="string" required="false" default="preside-objects.#arguments.object#.admin.add" />
<cfargument name="mergeWithFormName" type="string" required="false" default="" />
<cfargument name="audit" type="boolean" required="false" default="false" />
<cfargument name="auditAction" type="string" required="false" default="" />
<cfargument name="auditType" type="string" required="false" default="datamanager" />
Expand All @@ -1655,6 +1656,7 @@
<cfargument name="permissionContextKeys" type="array" required="false" default="#ArrayNew(1)#" />

<cfscript>
arguments.formName = Len( Trim( arguments.mergeWithFormName ) ) ? formsService.getMergedFormName( arguments.formName, arguments.mergeWithFormName ) : arguments.formName;
var formData = event.getCollectionForForm( formName=arguments.formName, stripPermissionedFields=arguments.stripPermissionedFields, permissionContext=arguments.permissionContext, permissionContextKeys=arguments.permissionContextKeys );
var labelField = presideObjectService.getObjectAttribute( object, "labelfield", "label" );
var obj = "";
Expand Down
26 changes: 16 additions & 10 deletions system/handlers/admin/devtools/terminalCommands/Reload.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@ component output=false hint="Reload all or part of your preside application" {

private function index( event, rc, prc ) {
var params = jsonRpc2Plugin.getRequestParams();
var environment = controller.getConfigSettings().environment;
var target = "";
var validTargets = {
all = { reloadMethod="reloadAll" , description="Reloads the entire application" , successMessage="Application cleared, please refresh the page to complete the reload" }
, db = { reloadMethod="dbSync" , description="Synchronises the database with Preside Object definitions", successMessage="Database objects synchronized" }
, caches = { reloadMethod="clearCaches" , description="Flushes all caches" , successMessage="Caches cleared" }
, forms = { reloadMethod="reloadForms" , description="Reloads the form definitions" , successMessage="Form definitions reloaded" }
, i18n = { reloadMethod="reloadI18n" , description="Reloads the i18n resource bundles" , successMessage="Resource bundles reloaded" }
, objects = { reloadMethod="reloadPresideObjects", description="Reloads the preside object definitions" , successMessage="Preside object definitions reloaded" }
, widgets = { reloadMethod="reloadWidgets" , description="Reloads the widget definitions" , successMessage="Widget definitions reloaded" }
, pageTypes = { reloadMethod="reloadPageTypes" , description="Reloads the page type definitions" , successMessage="Page type definitions reloaded" }
, static = { reloadMethod="reloadStatic" , description="Rescans and compiles JS and CSS" , successMessage="Static assets rescanned and recompiled" }
all = { reloadMethod="reloadAll" , flagRequiredInProduction=true , description="Reloads the entire application" , successMessage="Application cleared, please refresh the page to complete the reload" }
, db = { reloadMethod="dbSync" , flagRequiredInProduction=true , description="Synchronises the database with Preside Object definitions", successMessage="Database objects synchronized" }
, caches = { reloadMethod="clearCaches" , flagRequiredInProduction=false, description="Flushes all caches" , successMessage="Caches cleared" }
, forms = { reloadMethod="reloadForms" , flagRequiredInProduction=false, description="Reloads the form definitions" , successMessage="Form definitions reloaded" }
, i18n = { reloadMethod="reloadI18n" , flagRequiredInProduction=false, description="Reloads the i18n resource bundles" , successMessage="Resource bundles reloaded" }
, objects = { reloadMethod="reloadPresideObjects", flagRequiredInProduction=false, description="Reloads the preside object definitions" , successMessage="Preside object definitions reloaded" }
, widgets = { reloadMethod="reloadWidgets" , flagRequiredInProduction=false, description="Reloads the widget definitions" , successMessage="Widget definitions reloaded" }
, pageTypes = { reloadMethod="reloadPageTypes" , flagRequiredInProduction=false, description="Reloads the page type definitions" , successMessage="Page type definitions reloaded" }
, static = { reloadMethod="reloadStatic" , flagRequiredInProduction=false, description="Rescans and compiles JS and CSS" , successMessage="Static assets rescanned and recompiled" }
};

params = IsArray( params.commandLineArgs ?: "" ) ? params.commandLineArgs : [];
Expand All @@ -31,7 +32,12 @@ component output=false hint="Reload all or part of your preside application" {
return usageMessage;
}

target = validTargets[ params[1] ];
target = validTargets[ params[1] ];
var forceFlag = ( params[2] ?: "" ) == "--force";

if ( environment == "production" && ( target.flagRequiredInProduction ?: false ) && !forceFlag ) {
return Chr(10) & "[[b;red;]--force flag is required to perform this action in a production environment]" & Chr(10);
}

var start = GetTickCount();
applicationReloadService[ target.reloadMethod ]();
Expand Down
2 changes: 1 addition & 1 deletion system/handlers/formbuilder/DefaultRenderers.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ component {
}

private array function responseForExport( event, rc, prc, args={} ) {
return [ renderContent( renderer="plaintext", data=( args.response ?: "" ) ) ];
return [ args.response ?: "" ];
}
}

0 comments on commit befe87e

Please sign in to comment.